From fb95f413dd64f4c4ad434d7125925548c3ce2102 Mon Sep 17 00:00:00 2001 From: Resxt <55228336+Resxt@users.noreply.github.com> Date: Tue, 29 Mar 2022 19:58:19 +0200 Subject: [PATCH] give_perks_on_spawn 1.0 --- small_scripts/README.md | 6 ++++ small_scripts/give_perks_on_spawn.gsc | 42 +++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 small_scripts/give_perks_on_spawn.gsc diff --git a/small_scripts/README.md b/small_scripts/README.md index bfb09c8..002d7fc 100644 --- a/small_scripts/README.md +++ b/small_scripts/README.md @@ -25,6 +25,12 @@ Display the player's killstreak, total kills and deaths on top of the screen Print the GUID of a player in the console whenever he connects and whenever he chooses/changes class. +## give_perks_on_spawn.gsc + +Gives perks to a player whenever he spawns if he doesn't already have them. +This script has been written to give sleight of hand and quickdraw even if you have other perks like overkill (carry two primary weapons). +You can find the list of perks and pro perks in [perktable.csv](https://github.com/chxseh/MW3-GSC-Dump/blob/e9445976df9f91451fa6e5dc3cb4663390aafcec/_raw-files/mp/perktable.csv) + ## hardcore_tweaks.gsc The hardcore mode replaces some game functionalities like enabling friendly fire or disabling killcams. diff --git a/small_scripts/give_perks_on_spawn.gsc b/small_scripts/give_perks_on_spawn.gsc new file mode 100644 index 0000000..c0ffe2f --- /dev/null +++ b/small_scripts/give_perks_on_spawn.gsc @@ -0,0 +1,42 @@ +#include maps\mp\_utility; + +Init() +{ + level thread OnPlayerConnect(); +} + +OnPlayerConnect() +{ + for(;;) + { + level waittill("connected", player); + + player thread OnPlayerSpawned(); + } +} + +OnPlayerSpawned() +{ + self endon("disconnect"); + for(;;) + { + self waittill("changed_kit"); + + GivePerks(); + } +} + +GivePerks() +{ + if ( !self _hasPerk( "specialty_quickdraw" )) + { + self givePerk( "specialty_quickdraw", false ); // Quickdraw + self givePerk( "specialty_fastoffhand", false ); // Quickdraw Pro + } + + if ( !self _hasPerk( "specialty_fastreload" )) + { + self givePerk( "specialty_fastreload", false ); // Sleight of hand + self givePerk( "specialty_quickswap", false ); // Sleight of hand Pro + } +} \ No newline at end of file