22.04.2011, 09:50
(
Last edited by Ash.; 22/04/2011 at 09:56 AM.
Reason: I failed at typing.
)
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. ()
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 :)
}