24.07.2016, 21:53
Como faзo pra em vez de aparecer o lvl de ADM em numeros aparecer como cargo?
@Edit
Consegui por no /setadmin mas ai no /admins nгo consegui.
PHP код:
new Cargo[6][] = {{"Usuario"},{"Ajudante"},{"Sub-Adm"},{"Administrador"},{"Adiministrador-Chefe"},{"Lider-Geral"}};
CMD:admins(playerid, params[]) {
if(IsPlayerConnected(playerid))
{
new namep[MAX_PLAYER_NAME], nomep[100+MAX_PLAYER_NAME];
GetPlayerName(playerid, namep, sizeof(namep));
format(nomep, sizeof(nomep), "{CD853F}[PDM] >> O player %s usou o comando {FF0000}/ADMINS{CD853F}.",namep);
SendClientMessageToAll(-1, nomep);
SendClientMessage(playerid, 0x00FF00, "Admins Online:");
for(new i = 0; i <= MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i) == 1)
{
if(Stralioti[i][pAdministrador] > 0)
{
new string[100];
GetPlayerName(i, string, sizeof(string));
format(string, 50, "%s | Nivel: [%d]", string,Stralioti[i][pAdministrador]);
SendClientMessage(playerid,0x006800, string);
}
}
}
}
return 1;
}
Consegui por no /setadmin mas ai no /admins nгo consegui.
PHP код:
CMD:setadmin(playerid, params[]) {
new level, ganhou[MAX_PLAYER_NAME], deu[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,vermelho,"[ ! ] Comando nгo existe no serivdor.");
if(sscanf(params, "ud", Id, level)) return SendClientMessage(playerid, -1, "Use /setadmin [id] [level]");
if (level < 0 || level > 5) return SendClientMessage(playerid, -1, "Level invбlido. Use de 1 б 5 .");
if(!IsPlayerConnected(Id)) return SendClientMessage(playerid, -1, "Este jogador nгo estб online.");
GetPlayerName(Id, ganhou, sizeof(ganhou));
GetPlayerName(playerid, deu, sizeof(deu));
format(straliotiadmin, sizeof(straliotiadmin), "[ADM] >> Vocк deu cargo level %s para o player %s.", Cargo[level], ganhou);
SendClientMessage(playerid, 0xFF0000FF, straliotiadmin);
new arq[30];
format(arq,sizeof arq,"CONTAS/%s.ini",Nome(Id));
dini_IntSet(arq,"Admin",level);
format(straliotiadmin, sizeof(straliotiadmin), "[ADM] >> O admin %s deu cargo level %s para vocк.", deu, Cargo[level]);
SendClientMessage(Id, 0xFF0000FF, straliotiadmin);
Stralioti[Id][pAdministrador] = level;
return 1;
}