Saving Last Position
#1

I need someone to tell me how to make someone spawn at their last position after they've relogged. For example, If they register, spawn at airport, then go to San Fierro, and log off, when they log back on they spawn at San Fierro not back at Airport?

Also i need a /veh [ID] system?
Reply
#2

You have to save player position when he have relogged (for example in OnPlayerDisconnect) - use GetPlayerPos function and save it (i don't know what are you use for saving - i give example for files)

Код:
new Float:p[3];
GetPlayerPos(playerid, p[0], p[1], p[2]);

dini_FloatSet(file, "pos_x", p[0]);
dini_FloatSet(file, "pos_y", p[1]);
dini_FloatSet(file, "pos_z", p[2]);

//When player first spawn
SetPlayerPos(playerid, dini_FloatGet(...), dini_FloatGet(...), dini_FloatGet(...));
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)