Autosave Position Saving
#1

Hello everyone, I'm new to the forum, and am a newbie in scripting. Alright, I have got an autosave script, but the problem is it doesn't save your position. How can I make it so you could save your position?
Reply
#2

Make 3 floats

like this:

pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
Then just for the saving system x position is x
y is y etc.

what saving system do u use
Reply
#3

Quote:
Originally Posted by milanosie
Посмотреть сообщение
Make 3 floats

like this:

pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
Then just for the saving system x position is x
y is y etc.

what saving system do u use
I use a special one, made for the gamemode. It's in another language, the system is similar to SavePlayerData, but it doesn't save position. I tried this system, but I need that for example I am standing near a car, I would quit, the next time I log I would appear right there, near the car that I was standing, or for example I move to a roof, I quit, I appear there, so everytime your position would change, because you move around the map.
Reply
#4

I know, I am doing it myself.
Reply
#5

Quote:
Originally Posted by milanosie
Посмотреть сообщение
I know, I am doing it myself.
But this script somehow doesn't work :\ I used it in OnPlayerDisconnect
Reply
#6

dont,
On player discconect it sets its pos to blueberry,
save it in a timer
Reply
#7

Quote:
Originally Posted by milanosie
Посмотреть сообщение
dont,
On player discconect it sets its pos to blueberry,
save it in a timer
Sorry for bothering you, but I don't understand what you mean "in a timer" :\ Can you explain more widely? Thanks for the script tho
Reply
#8

top of script:

pawn Код:
new savetimer[MAX_PLAYERS];
At, Onplayerspawn
pawn Код:
savetimer[playerid] = SetTimerEx("asave", 10000, true, "i", playerid);
somewhere else:
pawn Код:
forward asave(playerid);
public asave(playerid)
{
//Here the pos saving and everything else u want to save, instead of onplayer disconnect
}
at OnPlayerDisconnect
pawn Код:
killtimer(savetimer[playerid]);
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)