SA-MP Forums Archive
Player respawn - 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)
+--- Thread: Player respawn (/showthread.php?tid=521570)



Player respawn - cnoopers - 23.06.2014

How we can check in OnPlayerSpawn is player after death?


Re: Player respawn - RenovanZ - 23.06.2014

pawn Код:
new Death[MAX_PLAYERS]; // put this wherever, under #include or #define

public OnPlayerDeath(playerid, killerid, reason)
{
    Death[playerid] = 1; // set the variable to 1, which mean, player is dead.
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(Death[playerid] == 1) // check the player death status
    {
        //if player spawns because of death, do something
    }
    return 1;
}



Re: Player respawn - VenomMancer - 23.06.2014

what you mean ?


Re: Player respawn - RenovanZ - 23.06.2014

Quote:
Originally Posted by VenomMancer
Посмотреть сообщение
what you mean ?
He wants to check, if player respawning (OnPlayerSpawn) because of death (OnPlayerDeath).