[Ajuda] Problema com Dialog
#1

Код:
	{
		if(IsPlayerConnected(id))
 		{
	    	if(arrayPlayer[id][PLevel] >= 1 && arrayPlayer[id][PLevel] <= 4)
	    	{
				switch(arrayPlayer[id][PLevel])
				{
				    case 1:
				        admins = "Moderador";
					case 2:
					    admins = "Sub-Admin";
					case 3:
					    admins = "Admin";
					case 4:
					    admins = "Master";
				}
				GetPlayerName(id, nome, sizeof(nome));
	    	    format(string, sizeof(string), "\"%s\" (%d) = %s", nome, id, admins);
	    	    SendClientMessage(playerid, 0x86ff00ff, string);
        	    AON++;
			}
		}
	}
	ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, " Admins:", string,"Ok","");
porque esse Dialog aparece apenas o ъltimo admin conectado, e nгo todos?
Reply
#2

pawn Код:
{
        if(IsPlayerConnected(id))
        {
            if(arrayPlayer[id][PLevel] >= 1 && arrayPlayer[id][PLevel] <= 4)
            {
                switch(arrayPlayer[id][PLevel])
                {
                    case 0:
                        admins = "Moderador";
                    case 1:
                        admins = "Sub-Admin";
                    case 2:
                        admins = "Admin";
                    case 3:
                        admins = "Master";
                }
                GetPlayerName(id, nome, sizeof(nome));
                format(string, sizeof(string), "\"%s\" (%d) = %s", nome, id, admins);
                SendClientMessage(playerid, 0x86ff00ff, string);
                AON++;
            }
        }
    }
    ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, " Admins:", string,"Ok","");
Reply
#3

oque vocк mudou?

Код:
	for(new id = 0; id < MAX_PLAYERS; ++id)
	{
		if(IsPlayerConnected(id))
 		{
	    	if(arrayPlayer[id][PLevel] >= 1 && arrayPlayer[id][PLevel] <= 4)
	    	{
				switch(arrayPlayer[id][PLevel])
				{
				    case 1:
				        admins = "Moderador";
					case 2:
					    admins = "Sub-Admin";
					case 3:
					    admins = "Admin";
					case 4:
					    admins = "Master";
				}
				GetPlayerName(id, nome, sizeof(nome));
	    	    format(string, sizeof(string), "\"%s\" (%d) = %s", nome, id, admins);
	    	    SendClientMessage(playerid, 0x86ff00ff, string);
        	    AON++;
			}
		}
	}
	ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, " Admins:", string,"Ok","");
Reply
#4

pawn Код:
case:0
Reply
#5

aff, case 0 vai pegar players level 0, case tem que comeзar com 1 porque level 1 pra cima que sгo administradores, isso nгo vai influenciar o Dialog @_@
Reply
#6

pawn Код:
for(new id = 0; id < MAX_PLAYERS; ++id)
    {
        if(IsPlayerConnected(id))
        {
            if(arrayPlayer[id][PLevel] >= 1 && arrayPlayer[id][PLevel] <= 4)
            {
                switch(arrayPlayer[id][PLevel])
                {
                    case 1:
                        admins = "Moderador";
                    case 2:
                        admins = "Sub-Admin";
                    case 3:
                        admins = "Admin";
                    case 4:
                        admins = "Master";
                }
                GetPlayerName(id, nome, sizeof(nome));
                    format(string, sizeof(string),"%s%s",string, "\"%s\" (%d) = %s", nome,id,admins);
                AON++;
            }
        }
    }
    ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, " Admins:", string,"Ok","");
Reply
#7

se matem:
pawn Код:
new Aremaz[200];
    for(new id = 0; id < MAX_PLAYERS; ++id)
    {
        if(IsPlayerConnected(id))
        {
            if(arrayPlayer[id][PLevel] >= 1 && arrayPlayer[id][PLevel] <= 4)
            {
                switch(arrayPlayer[id][PLevel])
                {
                    case 1:admins = "Moderador";
                    case 2:admins = "Sub-Admin";
                    case 3:admins = "Admin";
                    case 4:admins = "Master";
                }
                GetPlayerName(id, nome, sizeof(nome));
                format(string, sizeof(string), "\"%s\" (%d) = %s\n", nome, id, admins);
                strcat(Aremaz, string);
                AON++;
            }
        }
    }
    ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, " Admins:", Aremaz,"Ok","");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)