11.06.2013, 10:13
Yeah OnPlayerDeath automatically calls OnPlayerSpawn do something like this instead.
pawn Код:
new bool:JustDied[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
JustDied[playerid] = false;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
JustDied[playerid] = true;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(JustDied[playerid] == true)
{
SetPlayerPos(playerid,PlayerInfo[playerid][pPositionX], PlayerInfo[playerid][pPositionY], PlayerInfo[playerid][pPositionZ]);
SetPlayerFacingAngle(playerid,PlayerInfo[playerid][pAngle]);
SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
SetProgressBarValue(hungry[playerid], 100);
return 1;
}
return 1;
}