09.11.2012, 20:06
simples isso ainda marcarб em uma rquivo na Scripfiles
pawn Код:
if(strcmp(cmd, "/gmx", true) == 0 || strcmp(cmd, "/reiniciar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new string22[128], string[80];
if (PlayerInfo[playerid][pAdmin] >=MASTER)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != DONO) { return SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)"); }
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{ OnPlayerSave(i); }
}
GameTextForAll( "~g~G~y~M~b~X~n~~p~Reiniciando o servidor, Aguarde... ", 3000, 3);
SendClientMessageToAll(COLOR_ROXO, "Aguarde,em breve estaremos de volta.");
format(string, sizeof(string), "%s usou /gmx", PlayerName(playerid));
usougmx(string);
GameModeExitFunc();
SaveAccounts();
OnPlayerSave(playerid);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para dar GMX.");
}
}
return true;
}
forward usougmx(string[]);
public usougmx(string[])
{
new entry[256];
format(entry, sizeof(entry), "%s\r\n", string);
new File:hFile;
hFile = fopen("CMD.log", io_append);
fwrite(hFile, entry);
fclose(hFile);
return 1;
}
stock PlayerName(playerid)
{
new PlayerNameLevel[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerNameLevel, MAX_PLAYER_NAME);
return PlayerNameLevel;
}