[Ajuda] /admins em dialog.
#1

Bom, estou desenvolvendo um /admins em dialog mas nгo consigo :/
Se tiver 1 admin online no servidor, aparece o dialog de boa. Mas se tiver mais de um, o dialog nгo aparece.
Quem me ajudar, dou +REP
Obrigado.
Obs: Eu entrei em 2 contas usando o SandBoxie.
Print(se quiser):


CODE:

PHP код:
if(!strcmp(cmd"/admins"true) || !strcmp(cmd"/mods"true) || !strcmp(cmd"/administradores"true) || !strcmp(cmd"/moderadores"true))
    {
        new 
NickName[25];
        new 
temadm;
        foreach(
Playeri)
        {
            if(
DOF2_GetInt(f(i), "AdminL") == 1)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
GetPlayerName(iNickName25);
                    
temadm ++;
                     
format(stringsizeof(string), "~ %s [ID:%d] {1E90FF}Dono"NickNamei);
                }
            }
            if(
aInfo[i][Admin] == && DOF2_GetInt(f(i), "AdminL") == 0)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
GetPlayerName(iNickName25);
                    
temadm ++;
                     
format(stringsizeof(string), "~ %s [ID:%d] {1E90FF}Administrador"NickNamei);
                }
            }
              if(
aInfo[i][Moderador] == && DOF2_GetInt(f(i), "AdminL") == 0)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
GetPlayerName(iNickName25);
                    
temadm ++;
                     
format(stringsizeof(string), "~ %s [ID:%d] {00FF7F}Moderador"NickNamei);
                }
            }
               if(
aInfo[i][Ajudante] == && DOF2_GetInt(f(i), "AdminL") == 0)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
GetPlayerName(iNickName25);
                    
temadm ++;
                     
format(stringsizeof(string), "~ %s [ID:%d] {FFA500}Ajudante"NickNamei);
                }
            }
        }
        if(
temadm == 1){
        
ShowPlayerDialog(playeridADMINSDDIALOG_STYLE_MSGBOX"{FFFFFF}Administradores online:"string"Fechar""");
        return 
1;
        }
        if(
temadm == 1) return ShowPlayerDialog(playeridADMINSDDIALOG_STYLE_MSGBOX"{FFFFFF}Administradores online:""{FF0000}Nгo hб membros da Administraзгo online no momento'""Fechar""");
        return 
1;
        } 
Reply
#2

Quote:
Originally Posted by Luiiiz
Посмотреть сообщение
Bom, estou desenvolvendo um /admins em dialog mas nгo consigo :/
Se tiver 1 admin online no servidor, aparece o dialog de boa. Mas se tiver mais de um, o dialog nгo aparece.
Quem me ajudar, dou +REP
Obrigado.
Obs: Eu entrei em 2 contas usando o SandBoxie.
Print(se quiser):


CODE:

PHP код:
if(!strcmp(cmd"/admins"true) || !strcmp(cmd"/mods"true) || !strcmp(cmd"/administradores"true) || !strcmp(cmd"/moderadores"true))
    {
        new 
NickName[25];
        new 
temadm;
        foreach(
Playeri)
        {
            if(
DOF2_GetInt(f(i), "AdminL") == 1)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
GetPlayerName(iNickName25);
                    
temadm ++;
                     
format(stringsizeof(string), "~ %s [ID:%d] {1E90FF}Dono"NickNamei);
                }
            }
            if(
aInfo[i][Admin] == && DOF2_GetInt(f(i), "AdminL") == 0)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
GetPlayerName(iNickName25);
                    
temadm ++;
                     
format(stringsizeof(string), "~ %s [ID:%d] {1E90FF}Administrador"NickNamei);
                }
            }
              if(
aInfo[i][Moderador] == && DOF2_GetInt(f(i), "AdminL") == 0)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
GetPlayerName(iNickName25);
                    
temadm ++;
                     
format(stringsizeof(string), "~ %s [ID:%d] {00FF7F}Moderador"NickNamei);
                }
            }
               if(
aInfo[i][Ajudante] == && DOF2_GetInt(f(i), "AdminL") == 0)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
GetPlayerName(iNickName25);
                    
temadm ++;
                     
format(stringsizeof(string), "~ %s [ID:%d] {FFA500}Ajudante"NickNamei);
                }
            }
        }
        if(
temadm == 1){
        
ShowPlayerDialog(playeridADMINSDDIALOG_STYLE_MSGBOX"{FFFFFF}Administradores online:"string"Fechar""");
        return 
1;
        }
        if(
temadm == 1) return ShowPlayerDialog(playeridADMINSDDIALOG_STYLE_MSGBOX"{FFFFFF}Administradores online:""{FF0000}Nгo hб membros da Administraзгo online no momento'""Fechar""");
        return 
1;
        } 
coloca no comeзo do seu codigo!

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(VARIAVEL ADMIN)
            {
                DIALOG QUE MOSTRA QUANTIDADE DE ADMIN ON++;
            }
        }
    }
Reply
#3

Nгo entendi esse DIALOG QUE MOSTRA A QUANTIDADE DE ADMIN ON++... Pode me ajudar?
Reply
#4

Quote:
Originally Posted by Luiiiz
Посмотреть сообщение
Nгo entendi esse DIALOG QUE MOSTRA A QUANTIDADE DE ADMIN ON++... Pode me ajudar?
exemplo:
pawn Код:
if(Admin3 == 0) return ShowPlayerDialog(playerid, DAdmins, DIALOG_STYLE_MSGBOX, "Administradores online:", "Sem Administradores On no Momento!", "Fechar", "");
    else if(Admin3 > 0)
    {
        format(Admin, 128, "Olб %s, hб %d administradores online no Momento:\n\n", Nome(playerid), Admin3);
    }
Reply
#5

Pus e agora abre o dialog com os 2 admins. Mas sу pega um admin, quero que pegue todos online.
Como fica:
[IMG]blob:http://imgur.com/a976e905-f9dc-45f5-9349-59d183a01135[/IMG]
Reply
#6

Ops, errado:
Reply
#7

Mude new NickName[25]; Para new NickName[128]; E Mude o resto ,

EX :

pawn Код:
GetPlayerName(i, NickName, 25);
Para


pawn Код:
GetPlayerName(i, NickName, 128;
Reply
#8

Mesma coisa...
Continua sу aparecendo 1 admin. Quero que pegue todos os admins online.
Print:


Code atual:
PHP код:
if(!strcmp(cmd"/admins"true) || !strcmp(cmd"/mods"true) || !strcmp(cmd"/administradores"true) || !strcmp(cmd"/moderadores"true))
    {
      new 
NickName[128];
      new 
temadm;
    for(new 
0MAX_PLAYERSi++)
    {
    if(
IsPlayerConnected(i))
    {
    if(
DOF2_GetInt(f(i), "AdminL") == 1)
    {
    if(
aInfo[i][Oculto] == false)
    {
    
GetPlayerName(iNickName128);
    
temadm ++;
    
format(stringsizeof(string), "~ %s [ID:%d] {1E90FF}Dono"NickNamei);
    }
    }
    if(
aInfo[i][Admin] == && DOF2_GetInt(f(i), "AdminL") == 0)
    {
    if(
aInfo[i][Oculto] == false)
    {
     
GetPlayerName(iNickName128);
    
temadm ++;
    
format(stringsizeof(string), "~ %s [ID:%d] {1E90FF}Administrador"NickNamei);
    }
    }
    if(
aInfo[i][Moderador] == && DOF2_GetInt(f(i), "AdminL") == 0)
    {
    if(
aInfo[i][Oculto] == false)
    {
    
GetPlayerName(iNickName128);
    
temadm ++;
    
format(stringsizeof(string), "~ %s [ID:%d] {00FF7F}Moderador"NickNamei);
    }
    }
    if(
aInfo[i][Ajudante] == && DOF2_GetInt(f(i), "AdminL") == 0)
    {
    if(
aInfo[i][Oculto] == false)
    {
    
GetPlayerName(iNickName128);
    
temadm ++;
    
format(stringsizeof(string), "~ %s [ID:%d] {FFA500}Ajudante"NickNamei);
    }
    }
      }
    if(
temadm == 1){
    
ShowPlayerDialog(playeridADMINSDDIALOG_STYLE_MSGBOX"{FFFFFF}Administradores online:"string"Fechar""");
    return 
1;
    }
    if(
temadm == 1) return ShowPlayerDialog(playeridADMINSDDIALOG_STYLE_MSGBOX"{FFFFFF}Administradores online:""{FF0000}Nгo hб membros da Administraзгo online no momento'""Fechar""");
    return 
1;
    }
    } 
Reply
#9

Quote:
Originally Posted by Lucas_Rocha
Посмотреть сообщение
Mude new NickName[25]; Para new NickName[128]; E Mude o resto ,

EX :

pawn Код:
GetPlayerName(i, NickName, 25);
Para


pawn Код:
GetPlayerName(i, NickName, 128;
Desnecessбrio.
Reply
#10

Quero pegue todos os staffs online, sу pega 1... E sim, estб programado pro Moderador aparecer no /admins
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)