SA-MP Forums Archive
[REQUEST]Loading player last pos? - 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)
+--- Thread: [REQUEST]Loading player last pos? (/showthread.php?tid=341184)



[REQUEST]Loading player last pos? - BleverCastard - 09.05.2012

Can someone give me a description on how to load a players Last Position using Y_INI?
I have no idea on how to do this so yeah..
Thanks.


Re: [REQUEST]Loading player last pos? - Kudoz - 09.05.2012

You mean when On‌PlayerDisconnect = GetPlayerPos(playerid, ------); and OnPlayerConnect SetPlayerPos(playerid, ------); ?
( with savings in a file ofcourse.. ? )


Re: [REQUEST]Loading player last pos? - Yuryfury - 09.05.2012

Do GetPlayerPos and save the X,Y,Z to the user file. Then load them back when you want the player to be set to their last position.

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new Float:pos[3];
    GetPlayerPos(playerid,pos[0],pos[1],pos[3]);
    // Save these to the file
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new Float:pos[3];
    //load these from the file
    SetPlayerPos(playerid,pos[0],pos[1],pos[3]);
    return 1;
}
I don't really use Y-Ini, but you get the idea.


Re: [REQUEST]Loading player last pos? - Face9000 - 09.05.2012

[MP]Ditch,check this detailed tutorial,it will help you for sure.

https://sampforum.blast.hk/showthread.php?tid=299791