[Ajuda] /admins em Dialog
#1

Tentei colocar o /admins na Dialog, mas sу tб mostrando o ultimo admin conectado e nгo todos online.


aqui estб o cуdigo.

Код:
CMD:admins(playerid)
{
   	new file[60], Count;
 	each(Players->new i)
	{
	    if(Player[i][pLogged])
		{
			if(Player[i][pAdmin] != 0)
			{
				new s[128];
				new format_string[128];
			        Count++;
				format(file, sizeof(file), CONTAS, GetPlayerNameEx(i));
				if(Player[i][pAdmin] > 3)
				{
					//SendFormattedMessage(playerid, -1, "%d. {%06x}%s {FFFFFF}(%s) Funзгo: (%s)", VBCount, GetPlayerColor(i) >>> 8, GetPlayerNameEx(i), AccountName(i), DOF2_GetString(file, "FunзгoGM"));
    				strcat(s, "Nome\tCargo\tReports Lidos\tFunзгo\n");
					format(format_string, 128, "%d. {%06x}%s {FFFFFF}\t(%s)\t - \t(%s)", Count, GetPlayerColor(i) >>> 8, GetPlayerNameEx(i), AccountName(i), DOF2_GetString(file, "FunзгoGM"));
					strcat(s, format_string);
					ShowPlayerDialog(playerid, 998, DIALOG_STYLE_TABLIST_HEADERS, "Admins Online", s, "Fechar", "");
				}
				if(Player[i][pAdmin] <= 3)
                {
	  				strcat(s, "Nome\tCargo\tReports Lidos\tFunзгo\n");
					format(format_string, sizeof format_string, "%d. {%06x}%s {FFFFFF}\t(%s) \t(%d)\t -", Count, GetPlayerColor(i) >>> 8,GetPlayerNameEx(i), AccountName(i), Player[i][Reportslidos]);
					strcat(s, format_string);
					ShowPlayerDialog(playerid, 998, DIALOG_STYLE_TABLIST_HEADERS, "Admins Online", s, "Fechar", "");
				}
			}
		}
	}
	if(Count == 0) SendClientMessage(playerid, TEXTO, "Nгo hб administradores online!");
	return true;
}
Alguйm ajuda ?
Reply
#2

ShowPlayerDialog tem que estar fora do loop .
Reply
#3

Funcionou porйm que sempre um admin loga quando pula uma linha fica escrito "Nome"

Print: https://i.imgur.com/qexSSKM.png

OBS: O Cуdigo й o mesmo sу coloquei a dialog fora do loop.
Reply
#4

Coloca \n no final dos format.
Reply
#5

Coloquei o \n no final dos format, Porйm fica repetindo o titulo "Nome / Cargo ..."

Print: https://i.imgur.com/bNmj2Ae.png

Cada admin que entra esse nome fica em cima do nick dele.
Reply
#6

PHP код:
CMD:admins(playerid)
{
       new 
file[60], Countinfo[512]; // aumente aqui caso fique pouco
       
info "Nome\tCargo\tReports Lidos\tFunзгo\n";
     
each(Players->new i)
    {
        if(
Player[i][pLogged])
        {
            if(
Player[i][pAdmin] != 0)
            {
                ++
Count;
                
format(filesizeof(file), CONTASGetPlayerNameEx(i));
                
                if(
Player[i][pAdmin] > 3){
                    
format(infosizeof(info), "%s%d. {%06x}%s{FFFFFF}\t(%s)\t-\t(%s)"infoCountGetPlayerColor(i) >>> 8GetPlayerNameEx(i), AccountName(i), DOF2_GetString(file"FunзгoGM"));
                }
                if(
Player[i][pAdmin] <= 3){
                    
format(infosizeof(info), "%s%d. {%06x}%s{FFFFFF}\t(%s)\t(%d)\t-"infoCountGetPlayerColor(i) >>> 8GetPlayerNameEx(i), AccountName(i), Player[i][Reportslidos]);
                }
            }
        }
    }
    if(
Count != 0)
        return 
ShowPlayerDialog(playerid998DIALOG_STYLE_TABLIST_HEADERS"Admins Online"info"Fechar""");
    
SendClientMessage(playeridTEXTO"Nгo hб administradores online!");
    return 
true;

Reply
#7

@@@@RESOLVIDO
Reply
#8

Resolvido, Obrigado! + Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)