[Ajuda] Quebrando a cabeзa.
#1

Como faзo pra em vez de aparecer o lvl de ADM em numeros aparecer como cargo?

PHP код:
new Cargo[6][] = {{"Usuario"},{"Ajudante"},{"Sub-Adm"},{"Administrador"},{"Adiministrador-Chefe"},{"Lider-Geral"}};
CMD:admins(playeridparams[]) {
    if(
IsPlayerConnected(playerid))
    {
        new 
namep[MAX_PLAYER_NAME], nomep[100+MAX_PLAYER_NAME];
        
GetPlayerName(playeridnamepsizeof(namep));
        
format(nomepsizeof(nomep), "{CD853F}[PDM] >> O player %s usou o comando {FF0000}/ADMINS{CD853F}.",namep);
        
SendClientMessageToAll(-1nomep);
        
SendClientMessage(playerid0x00FF00"Admins Online:");
        for(new 
0<= MAX_PLAYERS; ++i)
        {
            if(
IsPlayerConnected(i) == 1)
            {
                if(
Stralioti[i][pAdministrador] > 0)
                {
                    new 
string[100];
                    
GetPlayerName(istringsizeof(string));
                    
format(string50"%s | Nivel: [%d]"string,Stralioti[i][pAdministrador]);
                    
SendClientMessage(playerid,0x006800string);
                }
            }
        }
    }
    return 
1;

@Edit

Consegui por no /setadmin mas ai no /admins nгo consegui.

PHP код:
CMD:setadmin(playeridparams[]) {
    new 
levelganhou[MAX_PLAYER_NAME], deu[MAX_PLAYER_NAME];
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid,vermelho,"[ ! ] Comando nгo existe no serivdor.");
    if(
sscanf(params"ud"Idlevel)) return SendClientMessage(playerid, -1"Use /setadmin [id] [level]");
    if (
level || 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(Idganhousizeof(ganhou));
    
GetPlayerName(playeriddeusizeof(deu));
    
format(straliotiadminsizeof(straliotiadmin), "[ADM] >> Vocк deu cargo level %s para o player %s."Cargo[level], ganhou);
    
SendClientMessage(playerid0xFF0000FFstraliotiadmin);
    new 
arq[30];
    
format(arq,sizeof arq,"CONTAS/%s.ini",Nome(Id));
    
dini_IntSet(arq,"Admin",level);
    
format(straliotiadminsizeof(straliotiadmin), "[ADM] >> O admin %s deu cargo level %s para vocк."deuCargo[level]);
    
SendClientMessage(Id0xFF0000FFstraliotiadmin);
    
Stralioti[Id][pAdministrador] =  level;
    return 
1;

Reply
#2

PHP код:
CMD:admins(playeridparams[]) {
        new
            
name_p[MAX_PLAYER_NAME],
            
nome_p100+MAX_PLAYER_NAME],
        ;
        
        
GetPlayerName(playeridname_psizeof(name_p));
        
        
format(nome_psizeof(nome_p), "{CD853F}[PDM] >> O player %s usou o comando {FF0000}/ADMINS{CD853F}.",name_p);
        
SendClientMessageToAll(-1nome_p);
        
        
SendClientMessage(playerid0x00FF00"Admins Online:");
        for(new 
0<= MAX_PLAYERS; ++i){
        
            if(
IsPlayerConnected(i)){
            
                if(
Stralioti[i][pAdministrador] > 0)
                {
                    
GetPlayerName(iname_pMAX_PLAYER_NAME);
                    
format(nome_psizeof(nome_p), "%s | Nivel: [%s]"name_pCargo[Stralioti[i][pAdministrador]]);
                    
SendClientMessage(playerid,0x006800nome_p);
                }
            }
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: