From 4c6b0e9aef234309bb4f56bac29debfb1fdfc481 Mon Sep 17 00:00:00 2001 From: Damen Date: Wed, 17 Apr 2019 19:54:41 -0400 Subject: [PATCH] fixes getting wanted while spectating a player in alcatraz --- gamemodes/irresistible/cnr/commands/admin/admin_one.pwn | 1 + gamemodes/irresistible/cnr/features/cop/jail.pwn | 2 +- gamemodes/irresistible/cnr/player.pwn | 1 + gamemodes/sf-cnr.pwn | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gamemodes/irresistible/cnr/commands/admin/admin_one.pwn b/gamemodes/irresistible/cnr/commands/admin/admin_one.pwn index e7d751c..fe5d0b0 100644 --- a/gamemodes/irresistible/cnr/commands/admin/admin_one.pwn +++ b/gamemodes/irresistible/cnr/commands/admin/admin_one.pwn @@ -655,6 +655,7 @@ CMD:specoff( playerid, params[ ] ) p_beingSpectated[ p_whomSpectating[ playerid ] ] = false; p_whomSpectating[ playerid ] = INVALID_PLAYER_ID; } + p_AlcatrazSpec[ playerid ] = g_iTime + 10; p_Spectating{ playerid } = false; SendServerMessage( playerid, "Spectation has been closed." ); } diff --git a/gamemodes/irresistible/cnr/features/cop/jail.pwn b/gamemodes/irresistible/cnr/features/cop/jail.pwn index f0e8187..2a13ec1 100644 --- a/gamemodes/irresistible/cnr/features/cop/jail.pwn +++ b/gamemodes/irresistible/cnr/features/cop/jail.pwn @@ -65,7 +65,7 @@ hook OnPlayerUpdateEx( playerid ) if ( IsPlayerAFK( playerid ) ) p_AlcatrazEscapeTS[ playerid ] = g_iTime + ALCATRAZ_TIME_PAUSE; // Money farmers? - if ( IsPlayerInDynamicArea( playerid, g_AlcatrazArea ) ) + if ( IsPlayerInDynamicArea( playerid, g_AlcatrazArea ) && g_iTime > p_AlcatrazSpec[ playerid ] ) { if ( !IsPlayerJailed( playerid ) && p_Class[ playerid ] != CLASS_POLICE && !IsPlayerDetained( playerid ) ) { diff --git a/gamemodes/irresistible/cnr/player.pwn b/gamemodes/irresistible/cnr/player.pwn index 76ca334..0ac02ff 100644 --- a/gamemodes/irresistible/cnr/player.pwn +++ b/gamemodes/irresistible/cnr/player.pwn @@ -172,6 +172,7 @@ new p_AntiExportCarSpam [ MAX_PLAYERS ], p_AntiMechFlipSpam [ MAX_PLAYERS ], bool: p_inAlcatraz [ MAX_PLAYERS char ], + p_AlcatrazSpec [ MAX_PLAYERS ], Text3D: p_TiedLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID, ... }, p_TiedBy [ MAX_PLAYERS ], p_BlowjobPrice [ MAX_PLAYERS ], diff --git a/gamemodes/sf-cnr.pwn b/gamemodes/sf-cnr.pwn index 8557d50..1996018 100644 --- a/gamemodes/sf-cnr.pwn +++ b/gamemodes/sf-cnr.pwn @@ -483,6 +483,7 @@ public OnPlayerDisconnect( playerid, reason ) p_Kidnapped { playerid } = false; p_Wood [ playerid ] = 0; p_inAlcatraz { playerid } = false; + p_AlcatrazSpec [ playerid ] = 0; p_Ropes [ playerid ] = 0; p_Scissors [ playerid ] = 0; p_Fires [ playerid ] = 0; @@ -4355,6 +4356,7 @@ public OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) if ( IsPlayerConnected( i ) && IsPlayerSpawned( i ) && !p_Spectating{ i } && i != playerid ) { ForceSpectateOnPlayer( playerid, i ); + p_AlcatrazSpec[ playerid ] = g_iTime + 10; break; } } @@ -4366,6 +4368,7 @@ public OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) if ( IsPlayerConnected( i ) && IsPlayerSpawned( i ) && !p_Spectating{ i } && i != playerid ) { ForceSpectateOnPlayer( playerid, i ); + p_AlcatrazSpec[ playerid ] = g_iTime + 10; break; } }