Rcon gmx vs exit
#4

I was pondering this a couple of weeks ago, i came up with this:

You could create your own gmx command?
Here's what i came up with. Doing it this way means you can pass your own reasoning to the OnPlayerDisconnect callback also. ()

pawn Code:
#define GMX 10

public OnRconCommand(cmd[])
{
    if(!strcmp("gmxex", cmd)) //Obviously you could edit the command name
    {
        for(new i; i < GetMaxPlayers(); i++)
        {
            OnPlayerDisconnect(i, GMX);
        }
        SendRconCommand("gmx");
        return 1;
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    //Here you could use the reason param to pass the reason of a restart :)
    if(reason == GMX)
    {
        //Your restart message maybe?
        //Or, cancel the OnPlayerDisconnect callback, as in:
        return 0;
    }
   
    //Then your other stuff :)
}
Reply


Messages In This Thread
Rcon gmx vs exit - by GaGlets(R) - 22.04.2011, 02:01
Re: Rcon gmx vs exit - by Miguel - 22.04.2011, 03:13
AW: Rcon gmx vs exit - by Meta - 22.04.2011, 05:10
Re: Rcon gmx vs exit - by Ash. - 22.04.2011, 09:50
Re: Rcon gmx vs exit - by GaGlets(R) - 22.04.2011, 11:37
Re: Rcon gmx vs exit - by Ash. - 22.04.2011, 22:27
Re: Rcon gmx vs exit - by Miguel - 23.04.2011, 00:41
Re: Rcon gmx vs exit - by dannyk0ed - 23.04.2011, 01:02
Re: Rcon gmx vs exit - by GaGlets(R) - 23.04.2011, 01:18
Re: Rcon gmx vs exit - by SaW_[VrTx] - 09.05.2011, 16:45

Forum Jump:


Users browsing this thread: 1 Guest(s)