SA-MP Forums Archive
Saving Positons. - 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: Saving Positons. (/showthread.php?tid=190845)



Saving Positons. - Tee - 16.11.2010

I read a FS kinda Tut on how to save positions, it worked once even when the player disconnects then connects, it realods the stats, can anyone tell me an easier way to do it that this


Re: Saving Positons. - cessil - 17.11.2010

pawn Код:
public OnPlayerDisconnect(playerid,reason)
{
    if(//check if the player id logged in here)
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid,x,y,z);
        //save your floats using whatever method you're using now
    }
    return 1;
}
public OnPlayerSpawn(playerid)
{
    if(//check if the player has logged in and this is their first time spawning)
    {
        new Float:x, Float:y, Float:z;
        //load the data here
        SetPlayerPos(playerid,x,y,z);
    }
    return 1;
}