remove buggy returnplayerhealth

This commit is contained in:
Lorenc Pekaj 2019-04-06 13:05:20 +11:00
parent bcd7561e33
commit b1b31ea891
2 changed files with 14 additions and 9 deletions

View File

@ -243,7 +243,7 @@ stock TazePlayer( victimid, playerid )
if ( IsPlayerInAnyVehicle( victimid ) ) return SendError( playerid, "This player is in a vehicle " );
if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot do this while you're inside a vehicle." );
if ( IsPlayerTazed( victimid ) ) return SendError( playerid, "This player is already tazed." );
if ( ReturnPlayerHealth( victimid ) <= 0.0 ) return SendError( playerid, "This player is dead." );
if ( IsPlayerDead( victimid ) ) return SendError( playerid, "This player is dead." );
//if ( IsPlayerCuffed( victimid ) ) return SendError( playerid, "This player is already cuffed." );
//if ( IsPlayerDetained( victimid ) ) return SendError( playerid, "This player is already detained." );
if ( IsPlayerGettingBlowed( playerid ) ) return SendError( playerid, "You cannot use this command since you're getting blowed." );
@ -297,7 +297,7 @@ stock ArrestPlayer( victimid, playerid )
if ( p_WantedLevel[ victimid ] == 0 ) return SendError( playerid, "This player is innocent!" );
if ( !IsPlayerCuffed( victimid ) ) return SendError( playerid, "This player is not cuffed." );
if ( IsPlayerKidnapped( playerid ) ) return SendError( playerid, "You are kidnapped, you cannot do this." );
if ( ReturnPlayerHealth( victimid ) <= 0.0 ) return SendError( playerid, "This player is dead." );
if ( IsPlayerDead( victimid ) ) return SendError( playerid, "This player is dead." );
//if ( IsPlayerDetained( victimid ) ) return SendError( playerid, "This player is detained, you cannot arrest them." );
if ( IsPlayerTied( playerid ) ) return SendError( playerid, "You are tied, you cannot do this." );
if ( IsPlayerJailed( victimid ) ) return SendError( playerid, "This player is jailed. He may be paused." );
@ -358,7 +358,7 @@ stock CuffPlayer( victimid, playerid )
if ( p_WantedLevel[ victimid ] == 0 ) return SendError( playerid, "This player is innocent!" );
if ( p_WantedLevel[ victimid ] < 6 ) return SendError( playerid, "This person isn't worth cuffing, ticket them." );
if ( IsPlayerInAnyVehicle( victimid ) ) return SendError( playerid, "This player is in a vehicle " );
if ( ReturnPlayerHealth( victimid ) <= 0.0 ) return SendError( playerid, "This player is dead." );
if ( IsPlayerDead( victimid ) ) return SendError( playerid, "This player is dead." );
//if ( IsPlayerDetained( victimid ) ) return SendError( playerid, "This player is already detained." );
if ( IsPlayerInAnyVehicle( playerid ) ) return SendError( playerid, "You cannot do this while you're inside a vehicle." );
if ( IsPlayerCuffed( victimid ) ) return SendError( playerid, "This player is already cuffed." );
@ -446,7 +446,7 @@ function Uncuff( playerid )
stock BreakPlayerCuffs( playerid )
{
if ( !IsPlayerConnected( playerid ) || ReturnPlayerHealth( playerid ) <= 0 ) return false;
if ( !IsPlayerConnected( playerid ) || IsPlayerDead( playerid ) ) return false;
if ( p_BobbyPins[ playerid ] < 1 )
{
@ -499,7 +499,7 @@ function BreakPlayerCuffsAttempt( playerid ) return BreakPlayerCuffs( playerid )
stock AwardNearestLEO( playerid, reason )
{
if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || ReturnPlayerHealth( playerid ) <= 0 )
if ( ! IsPlayerConnected( playerid ) || playerid == INVALID_PLAYER_ID || GetPlayerWantedLevel( playerid ) < 2 || IsPlayerDead( playerid ) )
return false;
new Float: radius = ( IsPlayerInAnyVehicle( playerid ) ? 150.0 : 75.0 ); // If player is in a vehicle, increase radius due to ability to get farther quicker.

View File

@ -16,7 +16,7 @@
#pragma option -d3
#pragma dynamic 7200000
#define DEBUG_MODE
// #define DEBUG_MODE
#if defined DEBUG_MODE
#pragma option -d3
@ -7117,8 +7117,13 @@ stock IsPlayerBelowSeaLevel( playerid )
return z < -2.0;
}
stock ReturnPlayerHealth( playerid )
stock IsPlayerDead( playerid )
{
new Float: health;
return GetPlayerHealth( playerid, health );
new
Float: health;
if ( GetPlayerHealth( playerid, health ) )
return health <= 0.0;
return GetPlayerState( playerid ) == PLAYER_STATE_WASTED;
}