iw7-mod/data/cdata/custom_scripts/cp_mp/inspect.gsc
2024-07-13 22:49:23 +03:00

48 lines
892 B
Plaintext

init()
{
level thread onPlayerConnect();
}
onPlayerConnect()
{
for( ;; )
{
level waittill( "connected", player );
player thread onPlayerSpawned();
}
}
watchWeaponInspection()
{
self endon( "death" );
self endon( "disconnect" );
self endon( "faux_spawn" );
if ( isai( self ) || isbot( self ) )
return;
self notifyonplayercommand( "weapon_inspection", "+actionslot 8" );
for (;;)
{
self waittill( "weapon_inspection" );
self iPrintLnBold("actionslot 8 pressed...");
self startweaponinspection();
wait 0.05;
while ( self isinspectingweapon() )
wait 0.05;
}
}
onPlayerSpawned()
{
self endon( "disconnect" );
for (;;)
{
scripts\engine\utility::waittill_any( "spawned_player", "faux_spawn" );
self thread watchWeaponInspection();
}
}