18.01.2018, 12:20
Quote:
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 ... |
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(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к 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); } else { 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", level); DOF2_SaveFile(); pAdmin[id] = level; return 1; }