Server Closes When GMX
#1

Hi all,

I made my own GMX command and when i use the command its restarting the server and then closes the server exe.
Код:
dcmd_restart(playerid,params[])
{
	#pragma unused params
    if(PlayerInfo[playerid][AdminLevel] >= 10)
	{
		foreach(Player,i)
		{
			if(IsPlayerConnected(i))
			{
				SavePlayer(i);
			}
		}
		SendRconCommand("gmx");
		//GameTextForAll("Server is restarting - Please Wait.",30000,5);
		return 1;
	}
	else
	{
		SendClientMessage(playerid, COLOR_RED, NO_PERM);
	}
	return 1;
}
It doesnt show anything in log that i am rejoined or something.
How can i fix this?

Admigo
Reply
#2

have you tried creating a timer with no repeat? try that that might work.

try this kind of method if this works.

pawn Код:
dcmd_restart(playerid,params[])
{
    #pragma unused params
    if(PlayerInfo[playerid][AdminLevel] >= 10)
    {
        foreach(Player,i)
        {
            if(IsPlayerConnected(i))
            {
                SavePlayer(i);
            }
        }
        SetTimer("ServerGMX",2000,0);//2 seconds with no repeat
        GameTextForAll("Server is restarting - Please Wait.",30000,5);
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, NO_PERM);
    }
    return 1;
}

forward ServerGMX();
public ServerGMX()
{
    SendRconCommand("gmx");
    return 1;
}
Reply
#3

Quote:
Originally Posted by pds2012
Посмотреть сообщение
have you tried creating a timer with no repeat? try that that might work.

try this kind of method if this works.

pawn Код:
dcmd_restart(playerid,params[])
{
    #pragma unused params
    if(PlayerInfo[playerid][AdminLevel] >= 10)
    {
        foreach(Player,i)
        {
            if(IsPlayerConnected(i))
            {
                SavePlayer(i);
            }
        }
        SetTimer("ServerGMX",2000,0);//2 seconds with no repeat
        GameTextForAll("Server is restarting - Please Wait.",30000,5);
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, NO_PERM);
    }
    return 1;
}

forward ServerGMX();
public ServerGMX()
{
    SendRconCommand("gmx");
    return 1;
}
Worked. Thanks(Rep+)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)