SA-MP Forums Archive
[Ajuda] /admins - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] /admins (/showthread.php?tid=656455)



/admins - KaioL - 16.07.2018

PHP код:
if(!strcmp(cmd, "/admins", true) || !strcmp(cmd, "/mods", true) || !strcmp(cmd, "/administradores", true) || !strcmp(cmd, "/moderadores", true))
    {
        new
            
adml, adm, mdr, hlp, crg,ContarAdmins,dialogst,Str[120];
        foreach(
Player, i)
        {
            if(
aInfo[i][Admin] == 1 || aInfo[i][Moderador] == 1 || aInfo[i][Ajudante] == 1)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
adml ++;
                     
format( string, sizeof( string ), "Admin\tCargo\tStatus\n{1E90FF}%s \t%s \tOnline\n",PlayerName( i ),Cargo( i ), i );
                     
strcat(Str, string);
                     
ShowPlayerDialog(playerid,657,DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Admins Online:", Str, "Okay", "");
                }
            }
        }
        if(
adm == 0 && mdr == 0 && adml == 0 && hlp == 0 && crg == 0) return ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "{FFFFFF}Admins Online [ {FF0000}0{FFFFFF} ]", "{FF0000}Nбo hб administrador ( ADM ) online no momento!'", "Fechar", ""); 
ta esse:


queria que ficasse assim:


alguem ajuda?


Re: /admins - InsaneBR - 16.07.2018

PHP код:
if(!strcmp(cmd, "/admins", true) || !strcmp(cmd, "/mods", true) || !strcmp(cmd, "/administradores", true) || !strcmp(cmd, "/moderadores", true))
    {
        new 
adml, adm, mdr, hlp,
            
crg, ContarAdmins, dialogst, Str[120], Teste[30];
        foreach(
Player, i)
        {
            if(
aInfo[i][Admin] == 1 || aInfo[i][Moderador] == 1 || aInfo[i][Ajudante] == 1)
            {
                if(
aInfo[i][Oculto] == false)
                {
                     
adml++;
                     
format( string, sizeof( string ), "Admin\tCargo\tStatus\n{1E90FF}%s \t%s \tOnline\n",PlayerName( i ),Cargo( i ), i );
                     
strcat(Str, string);
                     
format(Teste, sizeof(Teste), "{FFFFFF}Admins Online [%d]", adml);
                     
ShowPlayerDialog(playerid,657,DIALOG_STYLE_TABLIST_HEADERS, Teste, Str, "Okay", "");
                }
            }
        }
        if(
adm == 0 && mdr == 0 && adml == 0 && hlp == 0 && crg == 0) return ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "{FFFFFF}Admins Online [ {FF0000}0{FFFFFF} ]", "{FF0000}Nбo hб administrador ( ADM ) online no momento!'", "Fechar", ""); 



Re: /admins - KaioL - 16.07.2018

Quote:
Originally Posted by InsaneBR
Посмотреть сообщение
PHP код:
if(!strcmp(cmd, "/admins", true) || !strcmp(cmd, "/mods", true) || !strcmp(cmd, "/administradores", true) || !strcmp(cmd, "/moderadores", true))
    {
        new 
adml, adm, mdr, hlp,
            
crg, ContarAdmins, dialogst, Str[120], Teste[30];
        foreach(
Player, i)
        {
            if(
aInfo[i][Admin] == 1 || aInfo[i][Moderador] == 1 || aInfo[i][Ajudante] == 1)
            {
                if(
aInfo[i][Oculto] == false)
                {
                     
adml++;
                     
format( string, sizeof( string ), "Admin\tCargo\tStatus\n{1E90FF}%s \t%s \tOnline\n",PlayerName( i ),Cargo( i ), i );
                     
strcat(Str, string);
                     
format(Teste, sizeof(Teste), "{FFFFFF}Admins Online [%d]", adml);
                     
ShowPlayerDialog(playerid,657,DIALOG_STYLE_TABLIST_HEADERS, Teste, Str, "Okay", "");
                }
            }
        }
        if(
adm == 0 && mdr == 0 && adml == 0 && hlp == 0 && crg == 0) return ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "{FFFFFF}Admins Online [ {FF0000}0{FFFFFF} ]", "{FF0000}Nбo hб administrador ( ADM ) online no momento!'", "Fechar", ""); 
Muito obrigado amigo.


Re: /admins - KaioL - 16.07.2018

Quote:
Originally Posted by InsaneBR
Посмотреть сообщение
PHP код:
if(!strcmp(cmd, "/admins", true) || !strcmp(cmd, "/mods", true) || !strcmp(cmd, "/administradores", true) || !strcmp(cmd, "/moderadores", true))
    {
        new 
adml, adm, mdr, hlp,
            
crg, ContarAdmins, dialogst, Str[120], Teste[30];
        foreach(
Player, i)
        {
            if(
aInfo[i][Admin] == 1 || aInfo[i][Moderador] == 1 || aInfo[i][Ajudante] == 1)
            {
                if(
aInfo[i][Oculto] == false)
                {
                     
adml++;
                     
format( string, sizeof( string ), "Admin\tCargo\tStatus\n{1E90FF}%s \t%s \tOnline\n",PlayerName( i ),Cargo( i ), i );
                     
strcat(Str, string);
                     
format(Teste, sizeof(Teste), "{FFFFFF}Admins Online [%d]", adml);
                     
ShowPlayerDialog(playerid,657,DIALOG_STYLE_TABLIST_HEADERS, Teste, Str, "Okay", "");
                }
            }
        }
        if(
adm == 0 && mdr == 0 && adml == 0 && hlp == 0 && crg == 0) return ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_MSGBOX, "{FFFFFF}Admins Online [ {FF0000}0{FFFFFF} ]", "{FF0000}Nбo hб administrador ( ADM ) online no momento!'", "Fechar", ""); 
mano fico bom mais deu uns bug no dialog:



Re: /admins - bruxo00 - 16.07.2018

Porque й que estб a mostrar o dialog a cada iteraзгo do loop?


Re: /admins - KaioL - 16.07.2018

Quote:
Originally Posted by bruxo00
Посмотреть сообщение
Porque й que estб a mostrar o dialog a cada iteraзгo do loop?
Nгo entendi mano.