Help with returning after crash
#1

I saw many servers have a "Return after Crash" system or something like that..
So like after you get a crash, you login and return to your last position.
Can someone please tell me how to do it ? PLEASE PLEASE
Reply
#2

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/OnPlayerDisconnect
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)