27.06.2012, 00:49
Me ajuda criar um GMX eu procurei mais nenhum funfou
if (strcmp(cmd, "/gmx", true) == 0)
{
if //Aqui a variбvel do sistema de admin
{
OnFilterScriptExit();
SetTimer("Reiniciar", 3000, 0);
}
else
{
SendClientMessage(playerid, -1, "Vocк nгo pode usar esse comando!");
}
return 1;
}
forward Reiniciar();
public Reiniciar()
{
SendRconCommand("gmx");
}
// Topo
new gmxTick;
// Comando
if(!strcmp("/gmx", cmd, true))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Use /gmx <segundos>"); // Contagem
gmxTick = strval(tmp) + 1;
SetTimer("restartServer", 1000, 1);
return 1;
}
// Fim do script
forward restartServer();
public restartServer()
{
-- gmxTick;
new str[32];
format(str, sizeof(str), "GMX: ~r~%d", gmxTick);
GameTextForAll(str, 1000, 5);
if(gmxTick == 1)
SendRconCommand("gmx");
return 1;
}
|
pawn Код:
|
SetTimer("restartServer", strval(tmp)*1000, 0);
SendRconCommand("gmx");
//ou
OnGameModeExit();