SA-MP Forums Archive
Please help, my position is not saving to .ini when I use "gmx" - 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: Please help, my position is not saving to .ini when I use "gmx" (/showthread.php?tid=483687)



Please help, my position is not saving to .ini when I use "gmx" - Riwerry - 27.12.2013

Hello guys. I have got a problem. When is player connected on server and when I use "exit" command to the server console servers turns off and yes, everything si saved correctly. But problem happens, when i type to the server console "gmx" here it not save anymore the files

Can someone tell me why/how can I solve that?

Thankss


Re: Please help, my position is not saving to .ini when I use "gmx" - Hansrutger - 27.12.2013

It's probably because OnPlayerDisconnect and OnGameModeExit are not the same thing. If you save all the values into the .ini file also on OnGameModeExit, it should work.


Re: Please help, my position is not saving to .ini when I use "gmx" - Riwerry - 27.12.2013

I already have it in OnGameModeExit this saving. But as I said it only works when i type exit to turn server off. I guess so problem is when I call gmx there is not time to save these files, so I need to create some timers that call function saving accs for example 5 sec earlier and then it call gmx or something, do you know to make it?


Re: Please help, my position is not saving to .ini when I use "gmx" - Hansrutger - 27.12.2013

I guess it would work, don't know though. And I don't know if typing gmx in your console will create a timer ever unless you make the gmx command yourself somehow to work in the console.


Re: Please help, my position is not saving to .ini when I use "gmx" - zDevon - 27.12.2013

Make your own command to save everyone's data and use https://sampwiki.blast.hk/wiki/SendRconCommand afterwards to restart the server


Re: Please help, my position is not saving to .ini when I use "gmx" - Riwerry - 27.12.2013

Can someone make it please? I am not that good pawner :
Ofc, saving will I edit by me just dont know how to create timers put it to new cmd, etc..


Re: Please help, my position is not saving to .ini when I use "gmx" - zDevon - 27.12.2013

There are no timers needed.

pawn Код:
YCMD:restart(playerid, params[], help)
{
    if(IsPlayerAdmin(playerid)) {// Check if the player is logged into RCON or not.
        for(new i; i < MAX_PLAYERS; i++) {// Loop through all available player slots
            if(IsPlayerConnected(i)) {// Check which of those slots are filled
                // Your save code will go here. Replace instances of 'playerid' with 'i'
            }
        }
        SendRconCommand("gmx");
    }
    else return SendClientMessage(playerid,-1,"You are not authorized to use this command.");
    return 1;
}
This is in YCMD, and will need to be converted to whatever command processor you use. If you have foreach I would also switch out my loop but this will still work.


Re: Please help, my position is not saving to .ini when I use "gmx" - Riwerry - 27.12.2013

Thanks mate gonna to try it, I am using ycmd too


Re: Please help, my position is not saving to .ini when I use "gmx" - Riwerry - 27.12.2013

Mate still same problem, it wont save my .ini after used your command:

Interior = 0
PosX = 0.000000
PosY = 0.000000
PosZ = 0.000000
Skin = 0
Angle = 0.000000
VirtualWorld = 0


Re: Please help, my position is not saving to .ini when I use "gmx" - zDevon - 27.12.2013

Can I see your save code? Or just post the entire command again.