SA-MP Forums Archive
/accept death - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /accept death (/showthread.php?tid=190407)



/accept death - SkizzoTrick - 15.11.2010

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!


Re: /accept death - Retardedwolf - 15.11.2010

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.


Re: /accept death - SkizzoTrick - 15.11.2010

Thank you so much!