19.03.2014, 10:15
Are you sure variable "injured" is set correctly? and why use PVars? you can use regular variables for this.
And if I were you i'd use compound blocks instead of those lines, example:
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.
pawn Код:
new Injured[MAX_PLAYERS];
Injured[playerid] = 1;
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 !");
}
}