problem with /accept death
#2

Are you sure variable "injured" is set correctly? and why use PVars? you can use regular variables for this.
pawn Код:
new Injured[MAX_PLAYERS];

Injured[playerid] = 1;
And if I were you i'd use compound blocks instead of those lines, example:
pawn Код:
if(EMSOnline())
{
    SendClientMessageEx(playerid, COLOR_RED, "You cant accept death when EMS is available");
}
else
{
    if(GetPVarInt(playerid, "Injured") == 1)
    {                
        SendClientMessageEx(playerid, COLOR_WHITE, "You gave up hope and fell unconscious, you were immediately sent to the hospital.");
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "   You are not injured, you can't do this right now !");        
    }
}
This way its much more easier to look over { and }. You should probably set the players health to 0 aswell and move the code to OnPlayerDeath.
Reply


Messages In This Thread
problem with /accept death - by AustinWeerdGuy - 19.03.2014, 10:00
Re: problem with /accept death - by Voxel - 19.03.2014, 10:15
Re: problem with /accept death - by AustinWeerdGuy - 19.03.2014, 17:23
Re: problem with /accept death - by Sascha - 19.03.2014, 18:15
Re: problem with /accept death - by Carac - 19.03.2014, 20:24

Forum Jump:


Users browsing this thread: 1 Guest(s)