[Ajuda] Dialogo bugado
#1

Olб, nгo estou conseguindo fazer esse diбlogo, alguйm pode me ajudar? O Que eu fiz?

PHP код:
if (strcmp(cmd"/lideres"true) == 0
    { 
            if (
PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playeridCOLOR_GRAD1"ERRO: Vocк nгo tem nнvel administrativo suficiente."); 
            if (
PlayerInfo[playerid][pAdmDuty] != && PlayerInfo[playerid][pAdmin] <= 5) return SendClientMessage(playeridCOLOR_GRAD1"ERRO: Vocк nгo estб no modo admin! (/trabalhar)"); 
            for (new 
0MAX_PLAYERSi++) 
            { 
                if (
IsPlayerConnected(i)) 
                { 
                    new 
ttext[20]; 
                    if (
PlayerInfo[i][pLider] == 1
                    { 
                        
ttext "Polнcia Militar 1"
                    } 
                     else if (
PlayerInfo[i][pLider] == 1
                    { 
                        
ttext "Polнcia Militar 2"
                    } 
                    else if (
PlayerInfo[i][pLider] == 2
                    { 
                        
ttext "Polнcia Civil"
                    } 
                    else if (
PlayerInfo[i][pLider] == 3
                    { 
                        
ttext "Exйrcito"
                    } 
                    else if (
PlayerInfo[i][pLider] == 4
                    { 
                        
ttext "Departamento Mйdico"
                    } 
                    else if (
PlayerInfo[i][pLider] == 5
                    { 
                        
ttext "Varrios Los Aztecas"
                    } 
                    else if (
PlayerInfo[i][pLider] == 6
                    { 
                        
ttext "GRI"
                    } 
                    else if (
PlayerInfo[i][pLider] == 7
                    { 
                        
ttext "Governo"
                    } 
                    else if (
PlayerInfo[i][pLider] == 8
                    { 
                        
ttext "Assassinos"
                    } 
                    else if (
PlayerInfo[i][pLider] == 9
                    { 
                        
ttext "San News Repуrter"
                    } 
                    else if (
PlayerInfo[i][pLider] == 10
                    { 
                        
ttext "Poder Judiciбrio"
                    } 
                    else if (
PlayerInfo[i][pLider] == 12
                    { 
                        
ttext "Los Santos Vagos"
                    } 
                    else if (
PlayerInfo[i][pLider] == 13
                    { 
                        
ttext "SEMNOME2"
                    } 
                    else if (
PlayerInfo[i][pLider] == 14
                    { 
                        
ttext "Asphalt King"
                    } 
                    else if (
PlayerInfo[i][pLider] == 15
                    { 
                        
ttext "Grove Street"
                    } 
                    else if (
PlayerInfo[i][pLider] == 16
                    { 
                        
ttext "Front Yard Ballas"
                    } 
                    else if (
PlayerInfo[i][pLider] == 17
                    { 
                        
ttext "Street King"
                    } 
                    if (
PlayerInfo[i][pLider] >= 1
                    { 
                         new 
lideres[90000000];
                         for (new 
0MAX_DIALOGa++)  //como posso definir isso? MAX_DIALOG
                         
{
                             
format(lideressizeof a"Lider [%s]: %s"GetPlayerNameRP(playerid), ttext); 
                             
strcat(alideressizeof a); 
                             
//quero fazer um loop de dialogo, mais como eu faзo? estou com duvida, era pra mostrar todos os lideres online, mais tб mostrando apenas 1(1 linha)
                         
}
                    } 
                     
ShowPlayerDialog(playerid120DIALOG_STYLE_LIST"Lнderes online"dialog1"Fechar"""); 
                } 
        } 
        return 
1
    } 
Reply
#2

PHP код:
if (strcmp(cmd"/lideres"true) == 0)
    {
            if (
PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playeridCOLOR_GRAD1"ERRO: Vocк nгo tem nнvel administrativo suficiente.");
            if (
PlayerInfo[playerid][pAdmDuty] != && PlayerInfo[playerid][pAdmin] <= 5) return SendClientMessage(playeridCOLOR_GRAD1"ERRO: Vocк nгo estб no modo admin! (/trabalhar)");
            for (new 
0MAX_PLAYERSi++)
            {
                if (
IsPlayerConnected(i))
                {
                    new 
ttext[20];
                    switch(
PlayerInfo[i][pLider])
                    {
                        case 
1ttext "Polнcia Militar 1";
                        case 
2ttext "Polнcia Civil";
                        case 
3ttext "Exйrcito";
                        case 
4ttext "Departamento Mйdico";
                        case 
5ttext "Varrios Los Aztecas";
                        case 
6ttext "GRI";
                        case 
7ttext "Governo";
                        case 
8ttext "Assassinos";
                        case 
9ttext "San News Repуrter";
                        case 
10ttext "Poder Judiciбrio";
                        case 
12ttext "Los Santos Vagos";
                        case 
13ttext "Asphalt King";
                        case 
14ttext "Asphalt King";
                        case 
15ttext "Grove Street";
                        case 
16ttext "Front Yard Ballas";
                        case 
17ttext "Street King";
                    }
                    new 
lideres[1000];
                    for(new 
iMAX_PLAYERSi++)
                    {
                        if (
PlayerInfo[i][pLider] >= 1)
                        {
                                  if(!
IsPlayerConnected(i)) continue;
                                
format(lideressizeof(lideres), "%sLider [%s]: %s\n"lideresGetPlayerNameRP(playerid), ttext);
                         }
                    }
                    
ShowPlayerDialog(playerid120DIALOG_STYLE_LIST"Lнderes online"dialog1"Fechar""");
                }
        }
        return 
1;
    } 
Reply
#3

Nгo testei, mais acho que fiz certo, confere ai:

PHP код:
if (strcmp(cmd"/lideres"true) == 0)
{
    if (
PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playeridCOLOR_GRAD1"ERRO: Vocк nгo tem nнvel administrativo suficiente.");
    if (
PlayerInfo[playerid][pAdmDuty] != && PlayerInfo[playerid][pAdmin] <= 5) return SendClientMessage(playeridCOLOR_GRAD1"ERRO: Vocк nгo estб no modo admin! (/trabalhar)");
    for(new 
0MAX_PLAYERSi++)
    {
        new 
str[25], sstr[500];
        if(
IsPlayerConnected(i) && PlayerInfo[i][pLider] >= 1)
        {
            
format(strsizeof(str), "Lider [%s]: %s\n"GetPlayerNameRP(i), GetLider(i));
            
strcat(sstrstr);
        }
    }
ShowPlayerDialog(playerid120DIALOG_STYLE_LIST"Lнderes online"sstr"Fechar""");
    return 
1;
}
    
stock GetLider(playerid)
{
    new 
ttext[20];
    switch(
PlayerInfo[playerid][pLider])
    {
        case 
1ttext "Polнcia Militar 1";
         case 
2ttext "Polнcia Civil";
        case 
3ttext "Exйrcito";
        case 
4ttext "Departamento Mйdico";
        case 
5ttext "Varrios Los Aztecas";
        case 
6ttext "GRI";
        case 
7ttext "Governo";
        case 
8ttext "Assassinos";
        case 
9ttext "San News Repуrter";
        case 
10ttext "Poder Judiciбrio";
        case 
12ttext "Los Santos Vagos";
        case 
13ttext "Asphalt King";
        case 
14ttext "Asphalt King";
        case 
15ttext "Grove Street";
        case 
16ttext "Front Yard Ballas";
        case 
17ttext "Street King";
    }
    return 
ttext;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)