23.02.2014, 00:49
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.
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;
}