TABLIST_HEADERS and TABLIST dialogs
#1

Hello everyone.
I couldn't find anything explains me how to make a dialog with TABLIST_HEADERS or TABLIST style.

Can someone post here an example script ? How to make it ?
I saw some examples like \t and other bullshit and couldn't understand.

I need only #define dialog .... and ShowPlayerDialog with TABLIST_HEADERS or TABLIST styles.
I hope you understood me.

Thanks.
Reply
#2

From test_cmds fs:
PHP код:
TabListDialogTest(playerid)
{
    new 
listitems[(sizeof (weapinfo) * 16) + 1];
    for (new 
i!= sizeof (weapinfo); ++i)
    {
        
format(listitemssizeof (listitems), "%s%s\t$%i\n"listitemsweapinfo[i][weapname], weapinfo[i][weapid]);
    }
    
ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST,"Buy Weapon",listitems,"Select","Cancel");
}
TabListHeadersDialogTest(playerid)
{
    new 
listitems[] =
    
"Weapon\tPrice\tAmmo\n" \
    
"Deagle\t$5000\t100\n" \
    
"Sawnoff\t$5000\t100\n" \
    
"Pistol\t$1000\t50\n" \
    
"M4\t$10000\t100\n" \
    
"MP5\t$7500\t200\n" \
    
"Grenade\t$500\t1\n" \
    
"Parachute\t$10000\t1\n" \
    
"Lorikeet\t$50000\t500\n";
    
    
ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST_HEADERS,"Buy Weapon",listitems,"Select","Cancel");

Each "item" in a row needs to be separated by \t and you need to make a new line \n at the end of each row.
Reply
#3

Thank you.

If i want to show the dialog after entering an ammu-nation buying checkpoint, Can it be like this?:

pawn Код:
if(checkpointid == ammu....)
{
   TabListDialogTest(playerid)
   {
        new listitems[(sizeof (weapinfo) * 16) + 1];
        for (new i; i != sizeof (weapinfo); ++i)
        {    
             format(listitems, sizeof (listitems), "%s%s\t$%i\n", listitems, weapinfo[i][weapname], weapinfo[i][weapid]);
        }
       ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST,"Buy Weapon",listitems,"Select","Cancel");
   }
}
Reply
#4

Quote:
Originally Posted by aCloudy
Посмотреть сообщение
Thank you.

If i want to show the dialog after entering an ammu-nation buying checkpoint, Can it be like this?:

pawn Код:
if(checkpointid == ammu....)
{
   TabListDialogTest(playerid)
   {
        new listitems[(sizeof (weapinfo) * 16) + 1];
        for (new i; i != sizeof (weapinfo); ++i)
        {    
             format(listitems, sizeof (listitems), "%s%s\t$%i\n", listitems, weapinfo[i][weapname], weapinfo[i][weapid]);
        }
       ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST,"Buy Weapon",listitems,"Select","Cancel");
   }
}
Yes, that's how I made it on my script but I still can't make it to work the same way but with HEADERS :/
Reply
#5

Quote:
Originally Posted by aCloudy
Посмотреть сообщение
If i want to show the dialog after entering an ammu-nation buying checkpoint, Can it be like this?
Yes.

Quote:
Originally Posted by dionisak0s
Посмотреть сообщение
Yes, that's how I made it on my script but I still can't make it to work the same way but with HEADERS :/
You just add the headers at the beginning and change the type:
PHP код:
new listitems[(sizeof (weapinfo) * 16) + 25] = "Weapon Name\tWeapon ID\n";
for (new 
i!= sizeof (weapinfo); ++i)
{
    
format(listitemssizeof (listitems), "%s%s\t%i\n"listitemsweapinfo[i][weapname], weapinfo[i][weapid]);
}
ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST_HEADERS,"Weapon",listitems,"Select","Cancel"); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)