Restart Script
#1

Hi folks,

I have a restart script on my gamemode. The problem is when i use /restartserver [reason] command it restarts server but without filterscripts.

pawn Код:
if(strcmp(cmd, "/restartserver", true) == 0)
    {
        if(PInfo[playerid][AdminLevel] > 3)
        {
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_ERROR, "Syntax: /restartserver (reason)");
                return 1;
            }
            if(ServerRestarting == 1)
            {
                SendClientMessage(playerid, COLOR_ERROR, "The server is already restarting!");
                return 1;
            }
            new restartmsg[128];
            ServerRestarting = 1;
            format(restartmsg,sizeof(restartmsg),"Administrator {1B8AE4}%s(%d) {FFFFFF}has restarted the server • {1B8AE4}[Reason: %s]", PlayerName(playerid),playerid, result);
            SendClientMessageToAll(COLOR_WHITE, restartmsg);
            SendClientMessageToAll(COLOR_WHITE, "* Server restarting in {1B8AE4}30 {FFFFFF}seconds ...");
            SetTimerEx("RestartServer", 30000, false, "i", playerid);
            AdminLog(playerid, "/restartserver", result, "Everyone");
            return 1;
        }
pawn Код:
public RestartServer()
{
    SendRconCommand("gmx");
    return 1;
}
Reply


Messages In This Thread
Restart Script - by Latyos - 23.02.2014, 00:49
Re: Restart Script - by Aerotactics - 23.02.2014, 01:39
Re: Restart Script - by AF1_CLAN - 23.02.2014, 02:00
Re: Restart Script - by Latyos - 23.02.2014, 02:03
Re: Restart Script - by Aerotactics - 23.02.2014, 04:29
Re: Restart Script - by Scenario - 23.02.2014, 04:52

Forum Jump:


Users browsing this thread: 1 Guest(s)