Please help, my position is not saving to .ini when I use "gmx"
#1

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

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

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

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

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

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

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

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

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
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)