Loss of position, and position saves repeatedly.
#1

Well, my problem is especially in saving position.
I managed to make the position and all other data save when i quit, then join back.

So basically. *I join, register, move around for a while, and change some stats, then leave.* The console is still open. *I join in back, login, and im in my LAST position, and all my stats are fine.* I close the console, then reopen it. *I join in, login, im in blueberry and afaik it's my x,y,z coords are 0.00000, and data are fine.*

That's it, what confusing me is, my stuff have already been saved and the proof is i quited, and joined back and they are the same.

But on the server restart, they reset/change. >.>

However, my userfiles also have a problem, and i think it's related to my position problem, here is an example of one of my userfiles.

Код:
Password = 5E9201DA81C26E98F4E77EBE5BD15155CE51FA7101CCA046269273117FD550FF23DD6178659D04A0806A713A9BC030DE2DB575279788D4C2F245C79B039685AC
Skin = 60
Admin = 0
Money = 250
Level = 5
Gender = 1
Age = 21
Position X = 0.000000
Position Y = 0.000000
Position Z = 0.000000
IP = 127.0.0.1
Angle = 271.313415
Interior = 0
VirtualWorld = 0
BankMoney = 1000
Registered = 1
Position X = 2155.433593
Position Y = 21.516094
Position Z = 24.585172
Position X = 2176.706298
Position Y = 32.464546
Position Z = 26.467004
What are all those position saves? - _ -

Thank you.
Reply
#2

When you close your console, OnGameModeExit() is called, which means you gotta also save your player's data in that public. Have you? (if you save your player's data on OnPlayerDisconnect, just call it on OnGameModeExit() for all players)
Reply
#3

Quote:
Originally Posted by ranme15
Посмотреть сообщение
When you close your console, OnGameModeExit() is called, which means you gotta also save your player's data in that public. Have you? (if you save your player's data on OnPlayerDisconnect, just call it on OnGameModeExit() for all players)
You don't get my point, well mhm, i save it on OnPlayerDisconnect, but.. it saves already perfectly, and i go off, go on, and everything is fine, all of that happens while the console is on, then i log off again, and close the console, open it, log on, and my position is lost.

Feel free to tell me if im not specific. >.>
Reply
#4

Quote:
Originally Posted by Twistedz
Посмотреть сообщение
You don't get my point, well mhm, i save it on OnPlayerDisconnect, but.. it saves already perfectly, and i go off, go on, and everything is fine, all of that happens while the console is on, then i log off again, and close the console, open it, log on, and my position is lost.

Feel free to tell me if im not specific. >.>
Ah. I see.
May I see your OnPlayerDisconnect's saving data code?
Reply
#5

Obviously, here it is.

Код:
new INI:file = INI_Open(UserPath(playerid));
    INI_SetTag(file,"data");
    GetPlayerPos(playerid,pInfo[playerid][XPos],pInfo[playerid][YPos],pInfo[playerid][ZPos]);
    GetPlayerFacingAngle(playerid,pInfo[playerid][Angle]);
    INI_WriteFloat(file,"Position X",pInfo[playerid][XPos]);
    INI_WriteFloat(file,"Position Y",pInfo[playerid][YPos]);
    INI_WriteFloat(file,"Position Z",pInfo[playerid][ZPos]);
    INI_WriteInt(file,"Admin",pInfo[playerid][Admin]);
    INI_WriteInt(file,"Money",GetPlayerMoney(playerid));
    INI_WriteInt(file,"Level",GetPlayerScore(playerid));
    INI_WriteInt(file,"Race",pInfo[playerid][Race]);
    INI_WriteInt(file,"Age",pInfo[playerid][Age]);
    INI_WriteInt(file,"Skin",GetPlayerSkin(playerid));
    INI_WriteInt(file,"BankMoney",pInfo[playerid][BankMoney]);
    INI_WriteInt(file,"Gender",pInfo[playerid][Gender]);
    INI_WriteFloat(file,"Angle",pInfo[playerid][Angle]);
    INI_WriteInt(file,"Interior",GetPlayerInterior(playerid));
    INI_WriteInt(file,"VirtualWorld",GetPlayerVirtualWorld(playerid));
    INI_WriteInt(file,"Registered",pInfo[playerid][Registered]);
    INI_Close(file);
Reply
#6

Don't use spaces. Spaces mess everything up.
Reply
#7

Quote:
Originally Posted by Vince
Посмотреть сообщение
Don't use spaces. Spaces mess everything up.
Oh Vince, such helpful.

You exactly solved my issue, it's not saving repeatedly anymore, plus the position is fine.
Much thankies to you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)