Sum help with IsPlayerDead ( stock ) - 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: Sum help with IsPlayerDead ( stock ) (
/showthread.php?tid=223017)
Sum help with IsPlayerDead ( stock ) -
Mean - 08.02.2011
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...
Re: Sum help with IsPlayerDead ( stock ) - [L3th4l] - 08.02.2011
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.
Re: Sum help with IsPlayerDead ( stock ) -
Vince - 08.02.2011
Try:
pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_WASTED)