SA-MP Forums Archive
Respawn at same place after death - 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: Respawn at same place after death (/showthread.php?tid=297404)



Respawn at same place after death - Chrillzen - 15.11.2011

Fixed it myself.


Re: Respawn at same place after death - [MG]Dimi - 15.11.2011

PHP код:
new Float:X[MAX_PLAYERS],Float:Y[MAX_PLAYERS],Float:Z[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
    
X[playerid] = 0.0;
    
Y[playerid] = 0.0;
    
Z[playerid] = 0.0;//replace these 3 with your FIRST spawn positions
    
return 1;
}
public 
OnPlayerSpawn(playerid)
{
    
SetPlayerPos(playerid,X[playerid],Y[playerid],Z[playerid]);
    return 
1;
}
public 
OnPlayerDeath(playerid,killerid,reason)
{
    
GetPlayerPos(playerid,X[playerid],Y[playerid],Z[playerid]);
    return 
1;

NOTE: Untested!


Re: Respawn at same place after death - Epic_Mickey - 15.11.2011

Dont delete your question so others can maybe learn from your question.

Thank you -_-