[REQUEST]Loading player last pos?
#1

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.
Reply
#2

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

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.
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)