Sorry to tell you guys but thats function won't even work.
pawn Код:
public OnPlayerUpdate ( playerid )
{
new
Float:rW_Health ; //Create a float to store the player's health.
GetPlayerHealth ( playerid, rW_Health ); //Store the player's health.
if ( rW_Health <= 1.0 ) //Check if the player's health is lesser or 1.0
{
SetPlayerHealth ( playerid, 5.0 ); //Set the player's health for safety purposes
TogglePlayerControllable ( playerid, false ); //If his knocked out he can't move right?
SendClientMessage ( playerid, 0xFFFFFFAA, "You have been knocked out. /suicide to accept death"); //Tell him his knocked out.
}
return 1;
}
COMMAND:suicide( playerid, params [ ] ) //Process the command. (ZCMD required )
{
new
Float:rW_Health; //Create a float to store the player's health.
GetPlayerHealth ( playerid, rW_Health ); //Store the player's health.
if ( rW_Health == 5.0 ) //Check if the player's health is EXACTLY 5.0
{
SetPlayerHealth ( playerid, 0 ); //Kill them.
SendClientMessage ( playerid, 0xFFFFFFAA, "You have accepted your fate." ); //Them him he accepted his fate.
}
else
{
SendClientMessage ( playerid, 0xFFFFFFAA, "C'mon you still have the chance to live." ); //Tell him to fuck off cause he was never knocked out.
}
return 1;
}