[Ajuda] Dialog
#1

Entгo, to com esse cуdigo e nгo consigo passar ele para DIALOG_STYLE_TABLIST_HEADERS, pois todas as categorias que eu coloco, ela sai duplicada. Ou seja, o certo seria aparecer a Categoria que coloquei e em baixo os item, e oque esta acontecendo й que as categorias se repete a cada item que coloco.

Serб que alguem pode me explicar/ajudar nesse caso ?

pawn Код:
if(!strcmp(cmdtext, "/admins", true))
    {
    new Counts;
    new const Ranks[][] =
    {
    " {FFFF00}Ajudante ",
    " {FC851C}Moderador(a) ",
    " {008bce}Administrador(a) ",
    " {328E0A}Staff{FFFFFF} "
    };
    new const PlayerAfk[][] =
    {
    " Online ",
    " {FF0000}Ausente "
    };

    new STR[9999];
    new STX[3005], adminon;
    for(new x = 0, y = GetMaxPlayers(); x != y; x++)
    {
    if(!IsPlayerConnected(x)) continue;
    if(admin[x])
    {
    new NickName[25];
    GetPlayerName(x, NickName, 25);
    if(pAdmin[x] >= 2 && pAdmin[x] <= 6)
    {
    format(STR, 500, "Admin\tCargo\tStatus\n%s{FFFFFF}%s {FFFFFF}  \t%s{FFFFFF}  {FFFFFF}\t{00A600}%s{FFFFFF}\n", STR, NickName, Ranks[pAdmin[x] - 1], PlayerAfk[AFK[x] - 0]);
    adminon++;
    }
    Counts++;
    }
    }
    //teste
    if(adminon == 0)
    {
    ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "{FFFFFF}Admins [ {FF0000}0{FFFFFF} ]", "{FF0000}Nгo hб membros da Administraзгo online no momento !", "Fechar", "");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
    }
    else if(adminon == 1)
    {
    ShowPlayerDialog(playerid, 128, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Admins Online [ {328E0A}1 {FFFFFF}]", STR, "Fechar", "");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
    }
    else
    {
    //teste
    format(STX, 500, "{FFFFFF}Admins Online [ {328E0A}%d{FFFFFF} ]", adminon);
    ShowPlayerDialog(playerid, 500, DIALOG_STYLE_TABLIST_HEADERS, STX, STR, "Fechar", "");
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
    }
    return 1;
    }
PrintScreen: https://i.imgur.com/38zgBp3.png
Reply
#2

Nгo entendi, tem algum print ae ?
Reply
#3

Quote:
Originally Posted by DelK
Посмотреть сообщение
Nгo entendi, tem algum print ae ?
Tipo, eu queria fazer e deixar apenas as categorias la em cima, mais elas fica duplicando a cada ADMIN que loga.

PrintScreen:
Reply
#4

Quote:
Originally Posted by Geremias1533
Посмотреть сообщение
Tipo, eu queria fazer e deixar apenas as categorias la em cima, mais elas fica duplicando a cada ADMIN que loga.

PrintScreen:
Й que nгo estou achando a linha do admin\tCargo\tstatus kkkk, nгo sei se estou cego ou nгo estб ai no code mesmo'-'.
Reply
#5

Quote:
Originally Posted by DelK
Посмотреть сообщение
Й que nгo estou achando a linha do admin\tCargo\tstatus kkkk, nгo sei se estou cego ou nгo estб ai no code mesmo'-'.
Atualiza a pagina. (F5) '-'
Reply
#6

PHP код:
    if(!strcmp(cmdtext"/admins"true))
    {
    new 
Counts;
    new const 
Ranks[][] =
    {
    
" {FFFF00}Ajudante ",
    
" {FC851C}Moderador(a) ",
    
" {008bce}Administrador(a) ",
    
" {328E0A}Staff{FFFFFF} "
    
};
    new const 
PlayerAfk[][] =
    {
    
" Online ",
    
" {FF0000}Ausente "
    
};
    new 
STR[9999];
    new 
STX[3005], adminon;
    
format(STRsizeof(STR"Admin\tCargo\tStatus\n");
    for(new 
0GetMaxPlayers(); != yx++)
     {
    if(!
IsPlayerConnected(x)) continue;
    if(
admin[x])
    {
    new 
NickName[25];
    
GetPlayerName(xNickName25);
    if(
pAdmin[x] >= && pAdmin[x] <= 6)
    {
    
format(STR500"%s{FFFFFF}%s {FFFFFF}  \t%s{FFFFFF}  {FFFFFF}\t{00A600}%s{FFFFFF}\n"STRNickNameRanks[pAdmin[x] - 1], PlayerAfk[AFK[x] - 0]);
    
adminon++;
    }
    
Counts++;
     }
    }
    
//teste
    
if(adminon == 0)
    {
    
ShowPlayerDialog(playerid500DIALOG_STYLE_MSGBOX"{FFFFFF}Admins [ {FF0000}0{FFFFFF} ]""{FF0000}Nгo hб membros da Administraзгo online no momento !""Fechar""");
    
PlayerPlaySound(playerid10570.00.00.0);
    }
    else if(
adminon == 1)
    {
    
ShowPlayerDialog(playerid128DIALOG_STYLE_TABLIST_HEADERS"{FFFFFF}Admins Online [ {328E0A}1 {FFFFFF}]"STR"Fechar""");
    
PlayerPlaySound(playerid10570.00.00.0);
    }
     else
    {
    
//teste
    
format(STX500"{FFFFFF}Admins Online [ {328E0A}%d{FFFFFF} ]"adminon);
    
ShowPlayerDialog(playerid500DIALOG_STYLE_TABLIST_HEADERSSTXSTR"Fechar""");
    
PlayerPlaySound(playerid10570.00.00.0);
    }
     return 
1;
    } 
Reply
#7

Quote:
Originally Posted by DelK
Посмотреть сообщение
PHP код:
    if(!strcmp(cmdtext"/admins"true))
    {
    new 
Counts;
    new const 
Ranks[][] =
    {
    
" {FFFF00}Ajudante ",
    
" {FC851C}Moderador(a) ",
    
" {008bce}Administrador(a) ",
    
" {328E0A}Staff{FFFFFF} "
    
};
    new const 
PlayerAfk[][] =
    {
    
" Online ",
    
" {FF0000}Ausente "
    
};
    new 
STR[9999];
    new 
STX[3005], adminon;
    
format(STRsizeof(STR"Admin\tCargo\tStatus\n");
    for(new 
0GetMaxPlayers(); != yx++)
     {
    if(!
IsPlayerConnected(x)) continue;
    if(
admin[x])
    {
    new 
NickName[25];
    
GetPlayerName(xNickName25);
    if(
pAdmin[x] >= && pAdmin[x] <= 6)
    {
    
format(STR500"%s{FFFFFF}%s {FFFFFF}  \t%s{FFFFFF}  {FFFFFF}\t{00A600}%s{FFFFFF}\n"STRNickNameRanks[pAdmin[x] - 1], PlayerAfk[AFK[x] - 0]);
    
adminon++;
    }
    
Counts++;
     }
    }
    
//teste
    
if(adminon == 0)
    {
    
ShowPlayerDialog(playerid500DIALOG_STYLE_MSGBOX"{FFFFFF}Admins [ {FF0000}0{FFFFFF} ]""{FF0000}Nгo hб membros da Administraзгo online no momento !""Fechar""");
    
PlayerPlaySound(playerid10570.00.00.0);
    }
    else if(
adminon == 1)
    {
    
ShowPlayerDialog(playerid128DIALOG_STYLE_TABLIST_HEADERS"{FFFFFF}Admins Online [ {328E0A}1 {FFFFFF}]"STR"Fechar""");
    
PlayerPlaySound(playerid10570.00.00.0);
    }
     else
    {
    
//teste
    
format(STX500"{FFFFFF}Admins Online [ {328E0A}%d{FFFFFF} ]"adminon);
    
ShowPlayerDialog(playerid500DIALOG_STYLE_TABLIST_HEADERSSTXSTR"Fechar""");
    
PlayerPlaySound(playerid10570.00.00.0);
    }
     return 
1;
    } 
Deu erro nessa linha que vocк fez.
pawn Код:
format(STR, sizeof(STR, "Admin\tCargo\tStatus\n");
Nome do erro.
pawn Код:
error 001: expected token: ")", but found ","
Tentei fechar tambйm com outra ")" no final, mais o erro ainda persiste.

Tentei usar meus conhecimentos, mais nenhum deu certo.
Reply
#8

Код HTML:
format(STR, sizeof(STR), "Admin\tCargo\tStatus\n");
Reply
#9

PHP код:
if(!strcmp(cmdtext"/admins"true))
    {
    new 
Counts;
    new const 
Ranks[][] =
    {
    
" {FFFF00}Ajudante ",
    
" {FC851C}Moderador(a) ",
    
" {008bce}Administrador(a) ",
    
" {328E0A}Staff{FFFFFF} "
    
};
    new const 
PlayerAfk[][] =
    {
    
" Online ",
    
" {FF0000}Ausente "
    
};
    new 
STR[9999];
    new 
STX[3005], adminon;
    for(new 
0GetMaxPlayers(); != yx++)
     {
    if(!
IsPlayerConnected(x)) continue;
    if(
admin[x])
    {
    new 
NickName[25];
    
GetPlayerName(xNickName25);
    if(
pAdmin[x] >= && pAdmin[x] <= 6)
    {
        
strcat(STR"Admin\tCargo\tStatus\n");
        
format(Stringsizeof(String), "%s{FFFFFF}%s {FFFFFF}  \t%s{FFFFFF}  {FFFFFF}\t{00A600}%s{FFFFFF}\n"STZNickNameRanks[pAdmin[x] - 1], PlayerAfk[AFK[x] - 0]); strcat(STRString);
        
adminon++;
    }
    
Counts++;
     }
    }
    
//teste
    
if(adminon == 0)
    {
    
ShowPlayerDialog(playerid500DIALOG_STYLE_MSGBOX"{FFFFFF}Admins [ {FF0000}0{FFFFFF} ]""{FF0000}Nгo hб membros da Administraзгo online no momento !""Fechar""");
    
PlayerPlaySound(playerid10570.00.00.0);
    }
    else if(
adminon == 1)
    {
    
ShowPlayerDialog(playerid128DIALOG_STYLE_TABLIST_HEADERS"{FFFFFF}Admins Online [ {328E0A}1 {FFFFFF}]"STR"Fechar""");
    
PlayerPlaySound(playerid10570.00.00.0);
    }
     else
    {
    
//teste
    
format(STX500"{FFFFFF}Admins Online [ {328E0A}%d{FFFFFF} ]"adminon);
    
ShowPlayerDialog(playerid500DIALOG_STYLE_TABLIST_HEADERSSTXSTR"Fechar""");
    
PlayerPlaySound(playerid10570.00.00.0);
    }
     return 
1;
    } 
Tente..
Reply
#10

Quote:
Originally Posted by Marllun
Посмотреть сообщение
Код HTML:
format(STR, sizeof(STR), "Admin\tCargo\tStatus\n");
Deu certo, obrigado!
Obrigado a todos que comentou tambйm para me ajudar. (+RPs)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)