SA-MP Forums Archive
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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Respawn (/showthread.php?tid=141700)



Respawn - Tony1337 - 14.04.2010

Hello Again, I was wondering if anyone knows how to make it so when the player dies they spawn exactly back were they died. I'm guessing this is quiet simple but it would be awsome if i had a little help. Thanks again Guys!


Re: Respawn - Backwardsman97 - 15.04.2010

Try this out.

pawn Код:
new
    Float:X[MAX_PLAYERS],
    Float:Y[MAX_PLAYERS],
    Float:Z[MAX_PLAYERS];

public OnPlayerDeath(playerid)
{
    GetPlayerPos(playerid,X[playerid],Y[playerid],Z[playerid]);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerPos(playerid,X[playerid],Y[playerid],Z[playerid]);
    return 1;
}