if(strcmp(cmd, "/restart", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 3000)
{
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_WHITE, "[{339933}Gmx{FFFFFF}] O servidor foi reiniciado pelo Administrador, aguarde para poder logar novamente.");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
GameModeExit();
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando !");
}
}
return 1;
}
if(strcmp("/reiniciar", true, cmdtext 10) == 0)
{
if(IsPlayerAdmin(playerid))
{
for(new c; c < MAX_PLAYERS; c++)
{
if(IsPlayerConnected(c))
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "(ERRO) Vocк nгo pode usar este comando !");
{
SendClientMessageToAll(-1,"O servidor serб reiniciado em 4 segundos);
SetTimerEx("ReiniciarServidor", 4000, false, "i", playerid);
}
}
}
}
return 1;
}
stock ReiniciarServidor
{
SendClientMessage(playerid, -1,"O servidor estб sendo reiniciado. Espere 10 segundos e logue novamente");
Kick(c);
return GameModeExit();
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/restart", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] < 3000) return SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando !");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_WHITE, "[{339933}Gmx{FFFFFF}] O servidor foi reiniciado pelo Administrador, aguarde 10 segundos para poder logar novamente.");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
for(new i = 0, p = GetMaxPlayers(); i < p; i ++)
{
if(i == playerid) continue;
Kick(i);
}
SetTimer("Exit", 4000, false);
return 1;
}
return 0;
}
forward Exit();
public Exit() return GameModeExit();
Mais se kikasse o Jogador ele tinha q sair do jogo e entrar novamente --'
|
thanks a todos irei testar aki e ja edito
----------- EDIT ----------- TESTADO, ele ta kickando o cara, mas nao ta dando o RESTART^^ |
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/restart", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] < 3000) return SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a usar este comando !");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_WHITE, "[{339933}Gmx{FFFFFF}] O servidor foi reiniciado pelo Administrador, aguarde 10 segundos para poder logar novamente.");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
SendClientMessageToAll(COLOR_YELLOW, " ");
for(new i = 0, p = GetMaxPlayers(); i < p; i ++)
{
if(i == playerid) continue;
Kick(i);
}
SetTimer("Exit", 4000, false);
return 1;
}
return 0;
}
forward Exit();
public Exit() return SendRconCommand("gmx");