SA-MP Forums Archive
Returning to Last Position When Dying - 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: Returning to Last Position When Dying (/showthread.php?tid=305821)



Returning to Last Position When Dying - Sledge - 24.12.2011

Could some write a quick example of how I would teleport someone back to the location where they last were before they died?


Re: Returning to Last Position When Dying - IceCube! - 24.12.2011

pawn Код:
new float:X[MAX_PLAYERS], Float:Y[MAX_PLAYERS], float:Z[MAX_PLAYERS], dead[MAX_PLAYERS];
OnPLayerDeath
{
     GetPlayerPos(playerid, X[playerid], Y[playerid], Z[playerid]);
     dead[playerid] = 1;
return 1;
}
OnPlayerSpawn
{
  if(dead[playerid] = 1)
  {
    SetPlayerPos(playerid, X[playerid], Y[playerid], Z[playerid]);
    dead[playerid] = 0;
   }
 return 1;
}