give_perks_on_spawn 1.0

This commit is contained in:
Resxt
2022-03-29 19:58:19 +02:00
parent 793d769d19
commit fb95f413dd
2 changed files with 48 additions and 0 deletions

View File

@ -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
}
}