24.12.2009, 13:36
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
if(reason == 0)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
//write pos to file
//set a variable in the file to 1 if the player crashed
}
return 1;
}
public OnPlayerConnect(playerid)
{
if(the crash variable from the players file == 1)
{
SetPlayerPos(playerid, x, y, z); //the ones from the file
}
return 1;
}
https://sampwiki.blast.hk/wiki/OnPlayerConnect
https://sampwiki.blast.hk/wiki/File_Functions
You can also use (search) for dini instead of using the native file functions