new TempoContando;
new tempo = 60;
CMD:gmx(playerid, params[])
{
if(PlayerInfo[playerid][Admin] < 4) return SendClientMessage(playerid, 0xff0000ff, "(!) Aзгo exclusiva de administradores.");
format(String, sizeof(String), "O Admin {1B95E0}%s{00C2EC} Deu GMX no servidor, em alguns segundos ele serб reiniciado", Nome(playerid));
SendClientMessageToAll(-1, String);
for(new i = 0; i < MAX_PLAYERS; i++)
{
SalvarDados(i);
}
TempoContando = SetTimer("TempoGmx", 1000, true);
return 1;
}
forward TempoGmx();
public TempoGmx()
{
if(tempo == 0)
{
KillTimer(TempoContando);
GameTextForAll("~r~contagem terminada", 1000, 0);
SendRconCommand(#gmx);
return true;
}
format(String, sizeof(String), "~g~%d", tempo);
GameTextForAll(String, 1000, 5);
tempo--;
return 1;
}
new TempoContando;
new tempo;
CMD:gmx(playerid, params[])
{
if(PlayerInfo[playerid][Admin] < 4) return SendClientMessage(playerid, 0xff0000ff, "(!) Aзгo exclusiva de administradores.");
tempo = 60;
format(String, sizeof(String), "O Admin {1B95E0}%s{00C2EC} Deu GMX no servidor, em alguns segundos ele serб reiniciado", Nome(playerid));
SendClientMessageToAll(-1, String);
for(new i = 0; i < MAX_PLAYERS; i++)
{
SalvarDados(i);
}
TempoContando = SetTimer("TempoGmx", 1000, false);
return 1;
}
forward TempoGmx();
public TempoGmx()
{
if(tempo == 0)
{
KillTimer(TempoContando);
GameTextForAll("~r~contagem terminada", 1000, 0);
SendRconCommand(#gmx);
return true;
}
format(String, sizeof(String), "~g~%d", tempo);
GameTextForAll(String, 1000, 5);
tempo--;
return 1;
}
CMD:gmx(playerid, params[])
{
if(PlayerInfo[playerid][Admin] < 4) return SendClientMessage(playerid, 0xff0000ff, "(!) Aзгo exclusiva de administradores.");
format(String, sizeof(String), "O Admin {1B95E0}%s{00C2EC} Deu GMX no servidor, em alguns segundos ele serб reiniciado", Nome(playerid));
SendClientMessageToAll(-1, String);
TempoGmx(30, 0);
for(new i = 0; i < MAX_PLAYERS; i++)
{
SalvarDados(i);
}
return 1;
}
forward TempoGmx(start, end);
public TempoGmx(start, end)
{
if(start == 0)
{
GameTextForAll("~r~contagem terminada", 1000, 0);
SendRconCommand(#gmx);
return true;
}
format(String, sizeof(String), "~g~%d", start);
GameTextForAll(String, 1000, 5);
SetTimerEx("TempoGmx", 1000, false, "ii", --start, end);
return 1;
}
Nгo aparenta ter problemas, mais desta maneira ficaria mais otimizado. Tenta:
pawn Код:
|
Desculpe, estou meio dormindo, por isso nгo prestei atenзгo no que eu tinha feito.
![]() |