27.07.2015, 23:07
Код:
CMD:gmx(playerid) { if(playerController[playerid][playerAttrib] & ADMIN_TYPE_OWNER) { SendRconCommand("gmx"); return true; } return false; }
CMD:gmx(playerid) { if(playerController[playerid][playerAttrib] & ADMIN_TYPE_OWNER) { SendRconCommand("gmx"); return true; } return false; }
CMD:gmx(playerid) {
if(playerController[playerid][playerAttrib] & ADMIN_TYPE_OWNER) {
GameTextForAll("Reiniciando servidor em 1 minutos!", 5000, 3);
SendClientMessageToAll(0xA0A0A0, "GMX em 1 minutos!");
SetTimer("Timer_Restart_WarnPlayers", 1000 * 60, false);
return true;
} return false;
}
forward Timer_Restart_WarnPlayers();
public Timer_Restart_WarnPlayers()
{
GameTextForAll("Reiniciando servidor em 1 minuto!", 5000, 3);
SendClientMessageToAll(0xA0A0A0, "GMX em 1 minuto!");
SetTimer("Timer_Restart_Kick", 1000 * 60, false);
SendRconCommand("hostname Pending Restart");
SendRconCommand("password senhainutil");
return 1;
}
forward Timer_Restart_Kick();
public Timer_Restart_Kick()
{
GameTextForAll("Servidor reiniciando: Todos os players kickados!", 5000, 3);
for(new i; i < MAX_PLAYERS; i++)
Kick(i);
SetTimer("Timer_Restart_Reboot", 1000 * 5, false);
return 1;
}
forward Timer_Restart_Reboot();
public Timer_Restart_Reboot()
{
new HostCommand[128];
SendRconCommand("gmx");
format(HostCommand, 128, "hostname %s", GameModeName);
SendRconCommand(HostCommand);
SendRconCommand("password 0");
return 1;
}
CMD:gmx(playerid)
{
if(SuaVariavelDeAdmin) return SendClientMessage(playerid, -1, "Vocк Nгo Й Adm Autorizado!");
SendClientMessageToAll(-1, "Mensagem avisando que o servidor reinicia em 1min");
SetTimer("gmx", 1000 * 60, false);
return true;
}
forward gmx(playerid);
public gmx(playerid)
{
SendClientMessageToAll(-1, "Ultima mensagem antes do GMX");
SendRconCommand("gmx");
return true;
}
//Obs: feito via fуrum mesmo, comando nгo testado!