[Ajuda] /Admins sу mostra 1.
#1

Meu /Admins sу estб mostrando 1 dos membros da equipe. Tem 5 online sу aparece 1.
Code:
PHP код:
CMD:admins(playerid)
{
    new 
s[200], ss[200], iname[20];
    new 
ContarAdmins;
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
Jogador[i][Admin] > 0)
            {
                
GetPlayerName(iiname20);
                
format(ssizeof(s), "{FFFFFF}Nick(ID)\t{FFFFFF}Cargo\t{FFFFFF}Status\n%s(%d)\t%s\t%s\n"inameiCargoAdmin(i), StatusOnline(i));
                
strcat(sss);
                
ContarAdmins++;
            }
        }
    }
    if(
ContarAdmins >= 1)
    {
        
ShowPlayerDialog(playeridDIALOG_ADMINSDIALOG_STYLE_TABLIST_HEADERS"{FFFF00}Administradores {008040}Online"s"Fechar""");
    }
    if(
ContarAdmins == 0)
    {
        
SendClientMessage(playerid0xFF0000AA"| ERRO | Nгo hб administradores online no momento.");
    }
    return 
1;

Reply
#2

pawn Код:
CMD:admins(playerid)
{
    new ss[200], iname[20], ContarAdmins;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(Jogador[i][Admin] > 0)
            {
                GetPlayerName(i, iname, 20);
                format(ss, sizeof(ss), "{FFFFFF}Nick(ID)\t{FFFFFF}Cargo\t{FFFFFF}Status\n%s(%d)\t%s\t%s\n", iname, i, CargoAdmin(i), StatusOnline(i));
                strcat(ss, ss);
                ContarAdmins++;
            }
        }
    }
    if(ContarAdmins == 0)
    {
        ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "Nenhum membro da equipe online", ss, "Fechar", "");  
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_TABLIST_HEADERS, "{FFFF00}Administradores {008040}Online", ss, "Fechar", "");
    }    
    return 1;
}
Reply
#3

Quote:
Originally Posted by PetrickSchobaPS
Посмотреть сообщение
pawn Код:
CMD:admins(playerid)
{
    new ss[200], iname[20], ContarAdmins;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(Jogador[i][Admin] > 0)
            {
                GetPlayerName(i, iname, 20);
                format(ss, sizeof(ss), "{FFFFFF}Nick(ID)\t{FFFFFF}Cargo\t{FFFFFF}Status\n%s(%d)\t%s\t%s\n", iname, i, CargoAdmin(i), StatusOnline(i));
                strcat(ss, ss);
                ContarAdmins++;
            }
        }
    }
    if(ContarAdmins == 0)
    {
        ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "Nenhum membro da equipe online", ss, "Fechar", "");  
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_TABLIST_HEADERS, "{FFFF00}Administradores {008040}Online", ss, "Fechar", "");
    }    
    return 1;
}
Eu quero que repita sу a segunda parte. Repetiu a primeira tbm (Nick[ID] Cargo...)
Reply
#4

Quote:
Originally Posted by Luiiiz
Посмотреть сообщение
Eu quero que repita sу a segunda parte. Repetiu a primeira tbm (Nick[ID] Cargo...)
Tenta.

pawn Код:
CMD:admins(playerid)
{
    new ss[1500], iname[30], ContarAdmins;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(Jogador[i][Admin] > 0)
            {
                GetPlayerName(i, iname, 20);
                format(ss, sizeof(ss), "{FFFFFF}Nick(ID)\t{FFFFFF}Cargo\t{FFFFFF}Status\n%s(%d)\t%s\t%s\n", iname, i, CargoAdmin(i), StatusOnline(i));
                strcat(ss, ss);
                ContarAdmins++;
            }
        }
    }
    if(ContarAdmins == 0)
    {
        ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "Nenhum membro da equipe online", ss, "Fechar", "");  
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_TABLIST_HEADERS, "{FFFF00}Administradores {008040}Online", ss, "Fechar", "");
    }    
    return 1;
}
Reply
#5

Quote:
Originally Posted by PetrickSchobaPS
Посмотреть сообщение
Tenta.

pawn Код:
CMD:admins(playerid)
{
    new ss[1500], iname[30], ContarAdmins;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(Jogador[i][Admin] > 0)
            {
                GetPlayerName(i, iname, 20);
                format(ss, sizeof(ss), "{FFFFFF}Nick(ID)\t{FFFFFF}Cargo\t{FFFFFF}Status\n%s(%d)\t%s\t%s\n", iname, i, CargoAdmin(i), StatusOnline(i));
                strcat(ss, ss);
                ContarAdmins++;
            }
        }
    }
    if(ContarAdmins == 0)
    {
        ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "Nenhum membro da equipe online", ss, "Fechar", "");  
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_TABLIST_HEADERS, "{FFFF00}Administradores {008040}Online", ss, "Fechar", "");
    }    
    return 1;
}
Um else nгo vai mudar nada.
Reply
#6

Troca
pawn Код:
strcat(s, ss);
Por
pawn Код:
strcat(ss, s);
Reply
#7

Quote:
Originally Posted by ViniBorn
Посмотреть сообщение
Troca
pawn Код:
strcat(s, ss);
Por
pawn Код:
strcat(ss, s);
Continua a mesma coisa.
Reply
#8

PHP код:
CMD:admins(playerid,params[])
{
    new 
Count[MAX_PLAYERS];
    new 
string[500],f[MAX_PLAYER_NAME];
    foreach(
Playeri)// procurar pode se usar o GETMAXPLAYERS
    
{
            new 
An[128];
             switch(
Player[i][Admin])
              {
                case 
1An "Nнvel 1";
                case 
2An "Nнvel 2";
                case 
3An "Nнvel 3";
                case 
4An "Nнvel 4 (Dono)";
               }
            if(
Player[i][Admin] >=1) {
            
GetPlayerName(i,f,sizeof(f));
            
format(string,sizeof(string),"{7FFF00}%s » {FFFFFF}%s\n"i,fAn);
            
Count[i]++;
            
format(Celula,sizeof(Celula),"{FFFFFF}               Admins (%d) Online            "Count[i]);// aqui ele conta e da o valor como ++; й = 1 cada linha dara +1
        
}
    }
    if(
Count[playerid] == 0SendClientMessage(playerid, -1"Nгo hб administradores online no momento.");
    
ShowPlayerDialog(playerid0xFDIALOG_STYLE_MSGBOXCelulastring,"Fechar","");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)