fixes getting wanted while spectating a player in alcatraz

This commit is contained in:
Damen 2019-04-17 19:54:41 -04:00
parent 9c15082b3b
commit 4c6b0e9aef
4 changed files with 6 additions and 1 deletions

View File

@ -655,6 +655,7 @@ CMD:specoff( playerid, params[ ] )
p_beingSpectated[ p_whomSpectating[ playerid ] ] = false; p_beingSpectated[ p_whomSpectating[ playerid ] ] = false;
p_whomSpectating[ playerid ] = INVALID_PLAYER_ID; p_whomSpectating[ playerid ] = INVALID_PLAYER_ID;
} }
p_AlcatrazSpec[ playerid ] = g_iTime + 10;
p_Spectating{ playerid } = false; p_Spectating{ playerid } = false;
SendServerMessage( playerid, "Spectation has been closed." ); SendServerMessage( playerid, "Spectation has been closed." );
} }

View File

@ -65,7 +65,7 @@ hook OnPlayerUpdateEx( playerid )
if ( IsPlayerAFK( playerid ) ) if ( IsPlayerAFK( playerid ) )
p_AlcatrazEscapeTS[ playerid ] = g_iTime + ALCATRAZ_TIME_PAUSE; // Money farmers? 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 ) ) if ( !IsPlayerJailed( playerid ) && p_Class[ playerid ] != CLASS_POLICE && !IsPlayerDetained( playerid ) )
{ {

View File

@ -172,6 +172,7 @@ new
p_AntiExportCarSpam [ MAX_PLAYERS ], p_AntiExportCarSpam [ MAX_PLAYERS ],
p_AntiMechFlipSpam [ MAX_PLAYERS ], p_AntiMechFlipSpam [ MAX_PLAYERS ],
bool: p_inAlcatraz [ MAX_PLAYERS char ], bool: p_inAlcatraz [ MAX_PLAYERS char ],
p_AlcatrazSpec [ MAX_PLAYERS ],
Text3D: p_TiedLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID, ... }, Text3D: p_TiedLabel [ MAX_PLAYERS ] = { Text3D: INVALID_3DTEXT_ID, ... },
p_TiedBy [ MAX_PLAYERS ], p_TiedBy [ MAX_PLAYERS ],
p_BlowjobPrice [ MAX_PLAYERS ], p_BlowjobPrice [ MAX_PLAYERS ],

View File

@ -483,6 +483,7 @@ public OnPlayerDisconnect( playerid, reason )
p_Kidnapped { playerid } = false; p_Kidnapped { playerid } = false;
p_Wood [ playerid ] = 0; p_Wood [ playerid ] = 0;
p_inAlcatraz { playerid } = false; p_inAlcatraz { playerid } = false;
p_AlcatrazSpec [ playerid ] = 0;
p_Ropes [ playerid ] = 0; p_Ropes [ playerid ] = 0;
p_Scissors [ playerid ] = 0; p_Scissors [ playerid ] = 0;
p_Fires [ 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 ) if ( IsPlayerConnected( i ) && IsPlayerSpawned( i ) && !p_Spectating{ i } && i != playerid )
{ {
ForceSpectateOnPlayer( playerid, i ); ForceSpectateOnPlayer( playerid, i );
p_AlcatrazSpec[ playerid ] = g_iTime + 10;
break; break;
} }
} }
@ -4366,6 +4368,7 @@ public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
if ( IsPlayerConnected( i ) && IsPlayerSpawned( i ) && !p_Spectating{ i } && i != playerid ) if ( IsPlayerConnected( i ) && IsPlayerSpawned( i ) && !p_Spectating{ i } && i != playerid )
{ {
ForceSpectateOnPlayer( playerid, i ); ForceSpectateOnPlayer( playerid, i );
p_AlcatrazSpec[ playerid ] = g_iTime + 10;
break; break;
} }
} }