/accept death
#1

Hello,i want to know how to make a command /accept death(very good for RP servers)
I know that this been asked houndred times but everytime it didn't worked so please help!

When someone kill you,your character apply the (ex:crack animation) and ask you (JUST 1 time) to type /accept death!
If you type accept death,a lot of things happen(ill edit that)

So please help!
Reply
#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
#3

Thank you so much!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)