18.01.2018, 11:47
Comando /setadmin bem simples.
Algumas prints:
Digitando o comando /setadmin sem estar logado na RCON ou sem ser pAdmin = 4.
https://imgur.com/a/k6BLv
Digitando o comando /setadmin sem os parвmetros estando logado na RCON.
https://imgur.com/a/2onND
/setadmin id 0:
https://imgur.com/a/1cleB
/setadmin id 1:
https://imgur.com/a/KfzkY
/setadmin id 2:
https://imgur.com/a/faxVr
/setadmin id 3:
https://imgur.com/a/sO33B
/setadmin id 4:
https://imgur.com/a/tglZZ
Algumas prints:
Digitando o comando /setadmin sem estar logado na RCON ou sem ser pAdmin = 4.
https://imgur.com/a/k6BLv
Digitando o comando /setadmin sem os parвmetros estando logado na RCON.
https://imgur.com/a/2onND
/setadmin id 0:
https://imgur.com/a/1cleB
/setadmin id 1:
https://imgur.com/a/KfzkY
/setadmin id 2:
https://imgur.com/a/faxVr
/setadmin id 3:
https://imgur.com/a/sO33B
/setadmin id 4:
https://imgur.com/a/tglZZ
PHP Code:
CMD:setadmin(playerid, params[])
{
new id, level, string[200], pname[20], iname[20], file[50];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "| ERRO | Comando invбlido.");
if(IsPlayerAdmin(playerid) || pAdmin[playerid] == 4)
{
if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, 0xFF0000AA, "| ERRO | Use: /setadmin [id] [level 0-4]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000AA, "| ERRO | Esse ID nгo conectado.");
if(level > 4 || level < 0) return SendClientMessage(playerid, 0xFF0000AA, "| ERRO | Apenas leveis de 0 a 4.");
format(file, sizeof(file), "Contas/%s.ini", iname);
GetPlayerName(playerid, pname, 20);
GetPlayerName(id, iname, 20);
if(level == 0)
{
format(string, sizeof(string), "| Admin | Vocк removeu o(a) jogador(a) %s(%d) da Staff.", iname, id);
SendClientMessage(playerid, 0xFF0000AA, string);
format(string, sizeof(string), "| Admin | Vocк foi removido(a) da Staff pelo(a) Dono(a) %s(%d).", pname, playerid);
SendClientMessage(id, 0xFF0000AA, string);
DOF2_SetInt(file, "CargoAdm", 0);
DOF2_SaveFile();
pAdmin[id] = 0;
}
if(level == 1)
{
format(string, sizeof(string), "| Admin | Vocк promoveu o(a) jogador(a) %s(%d) a Ajudante.", iname, id);
SendClientMessage(playerid, 0xFF0000AA, string);
format(string, sizeof(string), "| Admin | Vocк foi promovido(a) a Ajudante pelo(a) Dono(a) %s(%d)", pname, playerid);
SendClientMessage(id, 0xFF0000AA, string);
DOF2_SetInt(file, "CargoAdm", 1);
DOF2_SaveFile();
pAdmin[id] = 1;
}
if(level == 2)
{
format(string, sizeof(string), "| Admin | Vocк promoveu o(a) jogador(a) %s(%d) a Moderador(a).", iname, id);
SendClientMessage(playerid, 0xFF0000AA, string);
format(string, sizeof(string), "| Admin | Vocк foi promovido(a) a Moderador(a) pelo(a) Dono(a) %s(%d)", pname, playerid);
SendClientMessage(id, 0xFF0000AA, string);
DOF2_SetInt(file, "CargoAdm", 2);
DOF2_SaveFile();
pAdmin[id] = 2;
}
if(level == 3)
{
format(string, sizeof(string), "| Admin | Vocк promoveu o(a) jogador(a) %s(%d) a Administrador(a).", iname, id);
SendClientMessage(playerid, 0xFF0000AA, string);
format(string, sizeof(string), "| Admin | Vocк foi promovido(a) a Administrador(a) pelo(a) Dono(a) %s(%d)", pname, playerid);
SendClientMessage(id, 0xFF0000AA, string);
DOF2_SetInt(file, "CargoAdm", 3);
DOF2_SaveFile();
pAdmin[id] = 3;
}
if(level == 4)
{
format(string, sizeof(string), "| Admin | Vocк promoveu o(a) jogador(a) %s(%d) a Dono(a)", iname, id);
SendClientMessage(playerid, 0xFF0000AA, string);
format(string, sizeof(string), "| Admin | Vocк foi promovido(a) a Dono(a) pelo(a) Dono(a) %s(%d)", pname, playerid);
SendClientMessage(id, 0xFF0000AA, string);
DOF2_SetInt(file, "CargoAdm", 4);
DOF2_SaveFile();
pAdmin[id] = 4;
}
}
return 1;
}