/accept death
#2

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
Sorry to tell you guys but thats function won't even work.


EDIT:Working version.

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;
}
Please search.
Reply


Messages In This Thread
/accept death - by SkizzoTrick - 15.11.2010, 07:59
Re: /accept death - by Retardedwolf - 15.11.2010, 08:04
Re: /accept death - by SkizzoTrick - 15.11.2010, 09:46

Forum Jump:


Users browsing this thread: 2 Guest(s)