Sum help with IsPlayerDead ( stock )
#1

pawn Код:
stock IsPlayerDead(playerid)
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    if(GetPlayerHealth(playerid, health) <= 0) return 1;
    else return 0;
}
pawn Код:
CMD:deathcheck(playerid, params[])
{
    if(IsPlayerDead(playerid))
        SendClientMessage(playerid, YELLOW, "You're dead");
    else
        SendClientMessage(playerid, YELLOW, "You are alive");
    return 1;
}
If I type /deathcheck, it will always say "You are alive", even if I am dead...
Reply
#2

How are you checking if you are dead or not? Are you using some variable that keeps you from spawning once you have 0 health? Cause when you die, you quickly spawn.
Reply
#3

Try:
pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_WASTED)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)