SA-MP Forums Archive
Return after crash script - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Return after crash script (/showthread.php?tid=87892)



Return after crash script - Ben147 - 22.07.2009

Can somebody help me to make a script to return the same place before crash
Thanks


Re: Return after crash script - James_Alex - 22.07.2009

look to the Los Angeles script
if youcan't find what you like !
answer this and i'll give you the code !


Re: Return after crash script - Ben147 - 23.07.2009

I cannot find it ://////


Re: Return after crash script - yezizhu - 23.07.2009

Client crash or server crash?


Re: Return after crash script - Ben147 - 23.07.2009

client crash.


Re: Return after crash script - yezizhu - 23.07.2009

Quote:
Originally Posted by Ben147
I cannot find it ://////
Try again.


Re: Return after crash script - Ben147 - 23.07.2009

i already tryed but i cannot find it


Re: Return after crash script - Ben147 - 23.07.2009

*bump*


Re: Return after crash script - Ben147 - 24.07.2009

bump ://////////


Re: Return after crash script - James_Alex - 24.07.2009

do not drible post plz
try this
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
  if(reason == 3)
  {
    new str[256], plname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, plname, sizeof(plname));
    format(str, sizeof(str), "%s.ini", plname);  
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    dini_IntSet(str, "crashed", 1);    
    dini_FloatSet(str, "X", X);
    dini_FloatSet(str, "Y", Y);
    dini_FloatSet(str, "Z", Z);
    return 1;
  }
  return 0;
}

public OnPlayerRequestSpawn(playerid)
{
  new str[256], plname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, plname, sizeof(plname));
  format(str, sizeof(str), "%s.ini", plname);  
  if(dini_Int(str, "crashed") == 1)  
  {
    SetPlayerPos(playerid, dini_Float(str, "X"), dini_Float(str, "Y"), dini_Float(str, "Z"));
    GameTextForPlayer(playerid, "~r~crahsed. ~w~returning to your last position", 10000, 1);
    dini_IntSet(str, "crashed", 0);    
    return 1;
  }
  return 0;
}