21.04.2012, 11:37
Make a variable like FirstSpawn[playerid], on connect its set to 0. When player spawn for the first time, do timer like this:
It will call for a public function called RestorePos:
pawn Код:
if(FirstSpawn[playerid] == 0) SetTimerEx("RestorePos", 500, false, "i", playerid);
pawn Код:
forward RestorePos(playerid);
public RestorePos(playerid)
{
SetPlayerPos(playerid, LAST X, LAST Y,LAST Z);
FirstSpawn[playerid] = 1; // setting this to 1 so it wont send player back on every spawn
GameTextForPlayer(playerid,"~y~Restored to last known pos",3000,1);
return 1;
}