Dialog style?
#1

How do I get this custom looking Dialog?

Reply
#2

Try \t in DIALOG_STYLE_MSGBOX
Reply
#3

So how would I place it in this?

Код:
CMD:wfdebt(playerid, params[])
{
    if(gTeam[playerid] == 2 || IsACop(playerid)|| PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pMember] == 7)
    {
        new string[128], x;

        foreach(Player, i)
        {
            if(GetPlayerCash(i) < 0)
            {
                format(string, sizeof(string), "%s\n%s:  |  %d$", string,GetPlayerNameEx(i),GetPlayerCash(i));
                x++;
            }
        }
        if(x != 0)
        {
            ShowPlayerDialog(playerid, 100, DIALOG_STYLE_MSGBOX, "Current Players Wanted in Debt:", string, "Okay", "");
        }
		else
		{
			if(GetPlayerCash(playerid) > 1)
			{
            	ShowPlayerDialog(playerid, 100, DIALOG_STYLE_MSGBOX, "Current Players Wanted in Debt:", string, "Okay", "");
				format(string, sizeof(string), "%s\nNo one is in debt!", string);
     			x++;
        	}
    	}
	 }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "   You're not a Cop / Debt Collectors or Government");
    }
    return 1;
}
Reply
#4

Try this:

PHP код:
CMD:wfdebt(playeridparams[])
{
    if(
gTeam[playerid] == || IsACop(playerid)|| PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pMember] == 7)
    {
        new 
string[128], x;

        foreach(
Playeri)
        {
            if(
GetPlayerCash(i) < 0)
            {
                
format(stringsizeof(string), "%s\n%s: \t %d$"string,GetPlayerNameEx(i),GetPlayerCash(i));
                
x++;
            }
        }
        if(
!= 0)
        {
            
ShowPlayerDialog(playerid100DIALOG_STYLE_MSGBOX"Current Players Wanted in Debt:"string"Okay""");
        }
        else
        {
            if(
GetPlayerCash(playerid) > 1)
            {
                
ShowPlayerDialog(playerid100DIALOG_STYLE_MSGBOX"Current Players Wanted in Debt:"string"Okay""");
                
format(stringsizeof(string), "%s\nNo one is in debt!"string);
                 
x++;
            }
        }
     }
    else
    {
        
SendClientMessageEx(playeridCOLOR_GREY"   You're not a Cop / Debt Collectors or Government");
    }
    return 
1;

Reply
#5

This is a dialog style that was added in 0.3.7. It's called "DIALOG_STYLE_TABLIST". You can read more about it here: https://sampwiki.blast.hk/wiki/Dialog_Styles

Basically, you are creating a message box that has both columns and rows. \n creates a new row, \t creates a new tab (or indentation / column).

This dialog would have looked similar to this:
PHP код:
ShowPlayerDialog(playerid1,  DIALOG_STYLE_TABLIST"Help Center: General Help",
    
"{FFFF00}Command\tHelp\n\
    {00FF00}/shout\t{FFFFFF}Ability to reach more persons with your character's voice\n\
    {00FF00}/me\t{FFFFFF}Ability to describe your character's movements in depth\n\
    etc."
,
    
"Next""Close"); 
Eventually your compiler will get angry with you when you exceed a certain length, so you're better off creating a large string and using 'strcat' for each line. Note that you cannot have more than 4 columns, so don't use more than 4 "\t"s on a single line.

An example can also be found on the Dialog Styles wiki page, with pictures included.
Reply
#6

DIALOG_STYLE_TABLIST
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)