Help with returning after crash
#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


Messages In This Thread
Help with returning after crash - by Jeka777 - 24.12.2009, 13:31
Re: Help with returning after crash - by dice7 - 24.12.2009, 13:36

Forum Jump:


Users browsing this thread: 1 Guest(s)