not showing this dialogue
#1

Hello, I have a problem, I made a system, but does not show the dialogue, I do not know what I did wrong, someone help me? please..

PHP код:
stock MostrarAdmins(playerid)
{
    new 
boolaavailableaonline;
    new 
dialog1[1500], arquivo[128], alevelcargo[64];
    for (new 
GetMaxPlayers(), i!= Ji++) {
        
format(arquivosizeof(arquivo), "Usuarios/%s.txt"GetPlayerNameEx(i));
        
alevel dini_Int(arquivo"AdminLevel");
        
aavailable alevel true false;
        switch(
alevel) {
            case 
0cargo "Moderador";
            case 
1cargo "Admin 1";
            case 
2cargo "Admin 2";
            case 
3cargo "Admin 3";
            case 
4cargo "Admin 4";
            case 
5cargo "Admin 5";
            case 
3000cargo "Admin 3000";
        }
        if(
aavailable) {
            new 
adm[25];
            
aonline IsPlayerLoggedIn(GetPlayerNameEx(i));
            
format(admsizeof dialog1"[%s] %s - %s\n"cargoGetPlayerNameEx(i), aonline ? ("Online") : ("Offline"));
            
strcat(dialog1admsizeof dialog1);
        }
    }
    
ShowPlayerDialog(playerid0DIALOG_STYLE_LIST"Administraзгo"dialog1"Fechar""");
    return 
1;

Reply
#2

Try set dialog id on 1
Reply
#3

Quote:
Originally Posted by TonyVk
Посмотреть сообщение
Try set dialog id on 1
It did not work, now I could verify that when using this function, the server is slow, crashes all, why? please !!
Reply
#4

try this:
Код:
stock MostrarAdmins(playerid)
{
    new bool: aavailable, aonline;
    new dialog1[1500], arquivo[128], alevel, cargo[64];

    for (new J = GetMaxPlayers(), i; i != J; i++) {
        format(arquivo, sizeof(arquivo), "Usuarios/%s.txt", GetPlayerNameEx(i));
        alevel = dini_Int(arquivo, "AdminLevel");
        aavailable = alevel > 0 ? true : false;

        switch(alevel) {
            case 0: cargo = "Moderador";
            case 1: cargo = "Admin 1";
            case 2: cargo = "Admin 2";
            case 3: cargo = "Admin 3";
            case 4: cargo = "Admin 4";
            case 5: cargo = "Admin 5";
            case 3000: cargo = "Admin 3000";
        }

        if(aavailable) {

            new adm[25];
            aonline = IsPlayerLoggedIn(GetPlayerNameEx(i));

            format(adm, sizeof dialog1, "[%s] %s - %s\n", cargo, GetPlayerNameEx(i), aonline ? ("Online") : ("Offline"));
            strcat(dialog1, adm, sizeof dialog1);
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Administraзгo", dialog1, "Fechar", "");
            }
       }
    return 1;
}
Reply
#5

Quote:
Originally Posted by jlalt
Посмотреть сообщение
try this:
Код:
stock MostrarAdmins(playerid)
{
    new bool: aavailable, aonline;
    new dialog1[1500], arquivo[128], alevel, cargo[64];

    for (new J = GetMaxPlayers(), i; i != J; i++) {
        format(arquivo, sizeof(arquivo), "Usuarios/%s.txt", GetPlayerNameEx(i));
        alevel = dini_Int(arquivo, "AdminLevel");
        aavailable = alevel > 0 ? true : false;

        switch(alevel) {
            case 0: cargo = "Moderador";
            case 1: cargo = "Admin 1";
            case 2: cargo = "Admin 2";
            case 3: cargo = "Admin 3";
            case 4: cargo = "Admin 4";
            case 5: cargo = "Admin 5";
            case 3000: cargo = "Admin 3000";
        }

        if(aavailable) {

            new adm[25];
            aonline = IsPlayerLoggedIn(GetPlayerNameEx(i));

            format(adm, sizeof dialog1, "[%s] %s - %s\n", cargo, GetPlayerNameEx(i), aonline ? ("Online") : ("Offline"));
            strcat(dialog1, adm, sizeof dialog1);
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Administraзгo", dialog1, "Fechar", "");
            }
       }
    return 1;
}
Thanks!!

@edit

It did not work, even he solved some problems, but the dialogue is shown several times this way: Images - results
Reply
#6

Quote:
Originally Posted by JoshNudock
Посмотреть сообщение
Thanks!!

@edit

It did not work, even he solved some problems, but the dialogue is shown several times this way: Images - results
Код:
stock MostrarAdmins(playerid)
{
    new bool: aavailable, aonline;
    new dialog1[1500], arquivo[128], alevel, cargo[64];

    for (new J = GetMaxPlayers(), i; i != J; i++) {
        format(arquivo, sizeof(arquivo), "Usuarios/%s.txt", GetPlayerNameEx(i));
        alevel = dini_Int(arquivo, "AdminLevel");
        aavailable = alevel > 0 ? true : false;

        switch(alevel) {
            case 0: cargo = "Moderador";
            case 1: cargo = "Admin 1";
            case 2: cargo = "Admin 2";
            case 3: cargo = "Admin 3";
            case 4: cargo = "Admin 4";
            case 5: cargo = "Admin 5";
            case 3000: cargo = "Admin 3000";
        }

        if(aavailable) {

            new adm[25];
            aonline = IsPlayerLoggedIn(GetPlayerNameEx(playerid));

            format(adm, sizeof dialog1, "[%s] %s - %s\n", cargo, GetPlayerNameEx(i), aonline ? ("Online") : ("Offline"));
            strcat(dialog1, adm, sizeof dialog1);
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Administraзгo", dialog1, "Fechar", "");
            }
       }
    return 1;
}
maybe that will fix it [ not sure ]
Reply
#7

Quote:
Originally Posted by jlalt
Посмотреть сообщение
Код:
stock MostrarAdmins(playerid)
{
    new bool: aavailable, aonline;
    new dialog1[1500], arquivo[128], alevel, cargo[64];

    for (new J = GetMaxPlayers(), i; i != J; i++) {
        format(arquivo, sizeof(arquivo), "Usuarios/%s.txt", GetPlayerNameEx(i));
        alevel = dini_Int(arquivo, "AdminLevel");
        aavailable = alevel > 0 ? true : false;

        switch(alevel) {
            case 0: cargo = "Moderador";
            case 1: cargo = "Admin 1";
            case 2: cargo = "Admin 2";
            case 3: cargo = "Admin 3";
            case 4: cargo = "Admin 4";
            case 5: cargo = "Admin 5";
            case 3000: cargo = "Admin 3000";
        }

        if(aavailable) {

            new adm[25];
            aonline = IsPlayerLoggedIn(GetPlayerNameEx(playerid));

            format(adm, sizeof dialog1, "[%s] %s - %s\n", cargo, GetPlayerNameEx(i), aonline ? ("Online") : ("Offline"));
            strcat(dialog1, adm, sizeof dialog1);
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Administraзгo", dialog1, "Fechar", "");
            }
       }
    return 1;
}
maybe that will fix it [ not sure ]
Hello, then, did not work, the problem is that the dialogue is shown non-stop and the lines are growing, slow server has been resolved, I tried to study and could not solve my studies.
Reply
#8

Код:
stock MostrarAdmins(playerid)
{
    new bool: aavailable, aonline;
    new dialog1[1500], arquivo[128], alevel, cargo[64];

    for (new J = GetMaxPlayers(), i; i != J; i++) {
        format(arquivo, sizeof(arquivo), "Usuarios/%s.txt", GetPlayerNameEx(i));
        alevel = dini_Int(arquivo, "AdminLevel");
        aavailable = alevel > 0 ? true : false;

        switch(alevel) {
            case 0: cargo = "Moderador";
            case 1: cargo = "Admin 1";
            case 2: cargo = "Admin 2";
            case 3: cargo = "Admin 3";
            case 4: cargo = "Admin 4";
            case 5: cargo = "Admin 5";
            case 3000: cargo = "Admin 3000";
        }

        if(aavailable) {

            new adm[25];
            aonline = IsPlayerLoggedIn(GetPlayerNameEx(i));

            format(adm, sizeof(dialog1), "[%s] %s - %s\n", cargo, GetPlayerNameEx(i), aonline ? ("Online") : ("Offline"));
            strcat(dialog1, adm, sizeof(dialog1));
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Administraзгo", dialog1, "Fechar", "");
            }
       }
    return 1;
}
if not work no more ideas xp
Reply
#9

try

PHP код:
// <?
stock MostrarAdmins
(playerid


    new    
        
// bools for admins
        
boolOnline,
        
boolNivel,
        
        
// simply arrays for
        
dialog[600],
        
arquivo[100],
        
nome[25],
        
cargo[15],
        
        
//for loopings:
        
ix
    
;
    
    for(
0x  GetPlayerPoolSize(); x; ++i){
        
        
GetPlayerName(inome24);
        
        
format(arquivo100"Usuarios/%s.txt"nome);
        if(
fexist(arquivo)){
            
            
Nivel dini_Int(arquivo"AdminLevel"); 
            
            switch(
Nivel){
                case 
0cargo "Moderador"
                case 
1cargo "Admin 1"
                case 
2cargo "Admin 2"
                case 
3cargo "Admin 3"
                case 
4cargo "Admin 4"
                case 
5cargo "Admin 5"
                case 
3000cargo "Admin 3000";     
            }
            
            if(
Nivel 0){
                
Online IsPlayerLoggedIn(nome);
                
format(arquivo100"[%s] %s - %s\n"cargonomeOnline ? ("Online") : ("Offline")); 
                
strcat(dialogarquivo);
            }
        }
        
        
ShowPlayerDialog(playerid0DIALOG_STYLE_LIST"Administraзгo"dialog"Fechar"#); 
    
}

    return 
1
}
Reply
#10

Quote:
Originally Posted by zSuYaNw
Посмотреть сообщение
try

PHP код:
// <?
stock MostrarAdmins
(playerid

    new    
        
// bools for admins
        
boolOnline,
        
boolNivel,
        
        
// simply arrays for
        
dialog[600],
        
arquivo[100],
        
nome[25],
        
cargo[15],
        
        
//for loopings:
        
ix
    
;
    
    for(
0x  GetPlayerPoolSize(); x; ++i){
        
        
GetPlayerName(inome24);
        
        
format(arquivo100"Usuarios/%s.txt"nome);
        if(
fexist(arquivo)){
            
            
Nivel dini_Int(arquivo"AdminLevel"); 
            
            switch(
Nivel){
                case 
0cargo "Moderador"
                case 
1cargo "Admin 1"
                case 
2cargo "Admin 2"
                case 
3cargo "Admin 3"
                case 
4cargo "Admin 4"
                case 
5cargo "Admin 5"
                case 
3000cargo "Admin 3000";     
            }
            
            if(
Nivel 0){
                
Online IsPlayerLoggedIn(nome);
                
format(arquivo100"[%s] %s - %s\n"cargonomeOnline ? ("Online") : ("Offline")); 
                
strcat(dialogarquivo);
            }
        }
        
        
ShowPlayerDialog(playerid0DIALOG_STYLE_LIST"Administraзгo"dialog"Fechar"#); 
    
}
    return 
1
}
Код:
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(2111) : warning 213: tag mismatch
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(2123) : warning 213: tag mismatch
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(2124) : warning 213: tag mismatch
PHP код:

stock MostrarAdmins
(playerid)
{
    new
        
// bools for admins
        
boolOnline,
        
boolNivel,
        
// simply arrays for
        
dialog[600],
        
arquivo[100],
        
nome[25],
        
cargo[15],
        
//for loopings:
        
ix
    
;
    for(
0x  GetPlayerPoolSize(); x; ++i){
        
GetPlayerName(inome24);
        
format(arquivo100"Usuarios/%s.txt"nome);
        if(
fexist(arquivo)){
            
Nivel dini_Int(arquivo"AdminLevel"); //error 1
            
switch(Nivel){
                case 
0cargo "Moderador";
                case 
1cargo "Admin 1";
                case 
2cargo "Admin 2";
                case 
3cargo "Admin 3";
                case 
4cargo "Admin 4";
                case 
5cargo "Admin 5";
                case 
3000cargo "Admin 3000";
            }
            if(
Nivel 0){ //error 2
                
Online IsPlayerLoggedIn(nome); //error 3
                
format(arquivo100"[%s] %s - %s\n"cargonomeOnline ? ("Online") : ("Offline"));
                
strcat(dialogarquivo);
            }
        }
        
ShowPlayerDialog(playerid0DIALOG_STYLE_LIST"Administraзгo"dialog"Fechar"#);
    
}
    return 
1;

I tried to take and could not, by warning is 213?

@edit

up!!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)