allow spawn protection to be disabled while setting a specific health

This commit is contained in:
Lorenc Pekaj 2019-02-18 00:01:37 +11:00
parent 7e7ab281e3
commit e88d6ffb20

View File

@ -123,11 +123,11 @@ stock IsPassivePlayerInVehicle( vehicleid )
return false; return false;
} }
stock DisablePlayerSpawnProtection( playerid ) stock DisablePlayerSpawnProtection( playerid, Float: default_health = 100.0 )
{ {
if ( p_AntiSpawnKillEnabled{ playerid } ) if ( p_AntiSpawnKillEnabled{ playerid } )
{ {
SetPlayerHealth( playerid, p_AdminOnDuty{ playerid } ? float( INVALID_PLAYER_ID ) : 100.0 ); SetPlayerHealth( playerid, p_AdminOnDuty{ playerid } ? float( INVALID_PLAYER_ID ) : default_health );
DisableRemoteVehicleCollisions( playerid, p_AdminOnDuty{ playerid } ); DisableRemoteVehicleCollisions( playerid, p_AdminOnDuty{ playerid } );
Delete3DTextLabel( p_SpawnKillLabel[ playerid ] ); Delete3DTextLabel( p_SpawnKillLabel[ playerid ] );
p_SpawnKillLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; p_SpawnKillLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID;