Detect dead player?
#1

My server saves ammo for player when he disconnects and also resets ammo when player dyes. The problem is that when the player dyes and disconnects in same second his ammo won't be reseted. The gamemode won't even detect that the player has health <= 0. Is it possible to detect player death with animations or something like that?
Reply
#2

Is that's it?

Код:
new IsDead[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    IsDead[playerid]=1;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    IsDead[playerid]=0;
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
if(IsDead[playerid] == 1)
{
//leaving while dead
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)