fixes detained kick on checkpoint

This commit is contained in:
Damen 2019-04-14 12:42:54 -04:00
parent 1dc53dffe5
commit edea5ff259
6 changed files with 22 additions and 17 deletions

View File

@ -271,12 +271,12 @@ CMD:uncuff( playerid, params[ ] )
CMD:detain( playerid, params[ ] ) CMD:detain( playerid, params[ ] )
{ {
new victimid; new victimid = GetClosestPlayer( playerid );
if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to police only." ); if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This is restricted to police only." );
else if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command since you're jailed." ); else if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this command since you're jailed." );
else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." ); else if ( p_Spectating{ playerid } ) return SendError( playerid, "You cannot use such commands while you're spectating." );
else if ( sscanf( params, "u", victimid ) ) return SendUsage( playerid, "/detain [PLAYER_ID]" ); //else if ( sscanf( params, "u", victimid ) ) return SendUsage( playerid, "/detain [PLAYER_ID]" );
else if ( victimid == playerid ) return SendError( playerid, "You cannot detain yourself." ); //else if ( victimid == playerid ) return SendError( playerid, "You cannot detain yourself." );
else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 4.0 && IsPlayerConnected( victimid ) ) else if ( GetDistanceBetweenPlayers( playerid, victimid ) < 4.0 && IsPlayerConnected( victimid ) )
{ {
if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player you're close to is in your team." ); if ( p_Class[ victimid ] == p_Class[ playerid ] ) return SendError( playerid, "This player you're close to is in your team." );

View File

@ -51,7 +51,7 @@ hook OnScriptInit( )
} }
hook OnPlayerEnterDynamicCP( playerid, checkpointid ) { hook OnPlayerEnterDynamicCP( playerid, checkpointid ) {
if ( IsPlayerJailed( playerid ) ) { if ( IsPlayerJailed( playerid ) && !IsPlayerDetained( playerid ) ) {
return SendError( playerid, "You're jailed, and you accessed a checkpoint. I smell a cheater." ), KickPlayerTimed( playerid ), Y_HOOKS_BREAK_RETURN_1; return SendError( playerid, "You're jailed, and you accessed a checkpoint. I smell a cheater." ), KickPlayerTimed( playerid ), Y_HOOKS_BREAK_RETURN_1;
} }
return 1; return 1;
@ -250,20 +250,20 @@ stock JailPlayer( playerid, seconds, admin = 0 )
PlayerTextDrawSetString ( playerid, p_JailTimeTD[ playerid ], "_" ); PlayerTextDrawSetString ( playerid, p_JailTimeTD[ playerid ], "_" );
PlayerTextDrawShow ( playerid, p_JailTimeTD[ playerid ] ); PlayerTextDrawShow ( playerid, p_JailTimeTD[ playerid ] );
// External Variables to Jail (resetting)
p_Cuffed { playerid } = false;
p_InfectedHIV { playerid } = false;
//p_Detained { playerid } = false;
//Delete3DTextLabel ( p_DetainedLabel[ playerid ] );
//p_DetainedLabel [ playerid ] = Text3D: INVALID_3DTEXT_ID;
//p_DetainedBy [ playerid ] = INVALID_PLAYER_ID;
// Primary Jail Variables // Primary Jail Variables
p_Jailed { playerid } = true; p_Jailed { playerid } = true;
p_JailTime [ playerid ] = seconds; p_JailTime [ playerid ] = seconds;
p_AdminJailed { playerid } = admin; p_AdminJailed { playerid } = admin;
p_JailTimer [ playerid ] = SetTimerEx( "Unjail", 950, true, "d", playerid ); p_JailTimer [ playerid ] = SetTimerEx( "Unjail", 950, true, "d", playerid );
// External Variables to Jail (resetting)
p_Cuffed { playerid } = false;
p_InfectedHIV { playerid } = false;
p_Detained { playerid } = false;
Delete3DTextLabel ( p_DetainedLabel[ playerid ] );
p_DetainedLabel [ playerid ] = Text3D: INVALID_3DTEXT_ID;
p_DetainedBy [ playerid ] = INVALID_PLAYER_ID;
CancelEdit ( playerid ); CancelEdit ( playerid );
RemovePlayerStolensFromHands( playerid ); RemovePlayerStolensFromHands( playerid );
StopPlayerUsingSlotMachine ( playerid ); StopPlayerUsingSlotMachine ( playerid );

View File

@ -556,6 +556,9 @@ CMD:sync( playerid, params[ ] )
if ( IsPlayerJailed( playerid ) ) if ( IsPlayerJailed( playerid ) )
return SendError( playerid, "You cannot use this feature while you are jailed." ); return SendError( playerid, "You cannot use this feature while you are jailed." );
if ( IsPlayerDetained( playerid ) )
return SendError( playerid, "You cannot use this feature while you are detained." );
if ( IsPlayerInAnyVehicle( playerid ) ) if ( IsPlayerInAnyVehicle( playerid ) )
return SendError( playerid, "You cannot synchronize yourself in a vehicle." ); return SendError( playerid, "You cannot synchronize yourself in a vehicle." );

View File

@ -1,4 +1,4 @@
v11.55.172 v11.55.174
v11.55.168 v11.55.168
v11.54.157 v11.54.157
v11.53.154 v11.53.154

View File

@ -1,4 +0,0 @@
(+) /detain and it's dropoff points are now active.
(/) City Harpoints have been adjusted to only fit the inner-city limits.
(/) XP Market and /perks are now based off Deathmatch and Robbery XP.
(*) Fixes the ID requirement for /taze, /cuff, and /arrest

View File

@ -0,0 +1,6 @@
(+) /detain and it's dropoff points are now active.
(/) City Harpoints have been adjusted to only fit the inner-city limits.
(/) XP Market and /perks are now based off Deathmatch and Robbery XP.
(*) Fixes the ID requirement for /taze, /cuff, and /arrest
(*) Detain no longer requires an ID to be put into the parameters.
(*) The server no longer thinks a player being detained is a cheating individual.