From e520129da29ae65da8fa015540b17645a980f14b Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Sat, 24 Nov 2018 05:22:32 +1100 Subject: [PATCH] spawn protection fix --- gamemodes/irresistible/cnr/features/gangs/turfs.pwn | 2 +- gamemodes/sf-cnr.pwn | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/gangs/turfs.pwn b/gamemodes/irresistible/cnr/features/gangs/turfs.pwn index 92e21ba..f3ca37a 100644 --- a/gamemodes/irresistible/cnr/features/gangs/turfs.pwn +++ b/gamemodes/irresistible/cnr/features/gangs/turfs.pwn @@ -389,7 +389,7 @@ public OnPlayerUpdateGangZone( playerid, zoneid ) if ( g_gangTurfData[ g_gangHardpointTurf ] [ E_ID ] != g_gangTurfData[ zoneid ] [ E_ID ] ) { PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], "~b~~h~(INACTIVE HARDPOINT)~n~~w~~h~Unchallenged" ); } else { - DisablePlayerSpawnProtection( playerid, false ); + DisablePlayerSpawnProtection( playerid ); PlayerTextDrawSetString( playerid, g_ZoneOwnerTD[ playerid ], sprintf( "~r~~h~(ACTIVE HARDPOINT)~n~~w~~h~%s", g_gangHardpointAttacker != INVALID_GANG_ID ? ( ReturnGangName( g_gangHardpointAttacker ) ) : ( "Unchallenged" ) ) ); } } diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index fd4b642..4089b0b 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -12735,15 +12735,16 @@ stock IsPlayerInMinigame( playerid ) { return IsPlayerInPaintBall( playerid ) || IsPlayerDueling( playerid ) || IsPlayerPlayingPool( playerid ) || IsPlayerPlayingPoker( playerid ); } -stock DisablePlayerSpawnProtection( playerid, bool: restore_health = true ) +stock DisablePlayerSpawnProtection( playerid ) { - if ( restore_health ) { + if ( p_AntiSpawnKillEnabled{ playerid } ) + { SetPlayerHealth( playerid, p_AdminOnDuty{ playerid } ? float( INVALID_PLAYER_ID ) : 100.0 ); + DisableRemoteVehicleCollisions( playerid, p_AdminOnDuty{ playerid } ); + Delete3DTextLabel( p_SpawnKillLabel[ playerid ] ); + p_SpawnKillLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; + p_AntiSpawnKillEnabled{ playerid } = false; } - DisableRemoteVehicleCollisions( playerid, p_AdminOnDuty{ playerid } ); - Delete3DTextLabel( p_SpawnKillLabel[ playerid ] ); - p_SpawnKillLabel[ playerid ] = Text3D: INVALID_3DTEXT_ID; - p_AntiSpawnKillEnabled{ playerid } = false; return 1; }