gmx saving problem
#7

I made this gmx command so it loops through everyone and gets their skin. When I type /gmx, it sets off a timer for 10 seconds, between the 10 seconds I only made it so it will save the skin:

pawn Код:
dcmd_gmx(playerid,params[])
{
    if(PlayerInfo[playerid][Level] >= 5 || IsPlayerAdmin(playerid))
    {
        new string[128];

        restartgm = SetTimer("RestartGM",10000,0);
        SendClientMessageToAll(COLOR_PINK,"***SERVER RESTART:  (ADMIN RESTART)  Server Restarting In 10 Seconds.");
        format(string,128,"Admin Server Restart (/gmx Refresh)"); print(string);

        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && PlayerInfo[i][LoggedIn] == 1)
            {
                new skinid = GetPlayerSkin(i);
                dUserSetINT(PlayerName2(i)).("savedskin",skinid);
                PlayerInfo[i][SavedSkin] = skinid;
            }
        }
        return 1;
    } else return SendClientMessage(playerid,red,"Invalid Command. Type   /cmds   For A List Of All Available Server Commands.");
}
Then when 10 seconds is up, this separate timer callback restarts the server:

pawn Код:
forward RestartGM();
public RestartGM()
{
    SendRconCommand("gmx");
    return 1;
}
Reply


Messages In This Thread
gmx saving problem - by grand.Theft.Otto - 11.07.2012, 01:14
Re: gmx saving problem - by coole210 - 11.07.2012, 01:23
Re: gmx saving problem - by ReneG - 11.07.2012, 01:24
Re: gmx saving problem - by coole210 - 11.07.2012, 01:27
Re: gmx saving problem - by ReneG - 11.07.2012, 01:30
Re: gmx saving problem - by coole210 - 11.07.2012, 01:32
Re: gmx saving problem - by grand.Theft.Otto - 11.07.2012, 01:40
Re: gmx saving problem - by coole210 - 11.07.2012, 01:42
Re: gmx saving problem - by grand.Theft.Otto - 11.07.2012, 01:49
Re: gmx saving problem - by ReneG - 11.07.2012, 01:52

Forum Jump:


Users browsing this thread: 2 Guest(s)