About Dialog
#1

Код:
if(!strcmp(cmdtext, "/bag", true, 4))
    {
		new itemlist[ 128 ], itemName[ 30 ], itemDesc[ 100 ], itemAmm, idx;
        while( listInventoryItems( playerid, itemName, itemDesc, itemAmm, idx ) )
        {
	       	format( itemlist, sizeof itemlist, "%s (%i)", itemName, itemAmm );
	       	SendClientMessage( playerid, -1, itemlist );
           	idx ++;
		}
        if(!idx) return SendClientMessage(playerid, COLOR_BLUE2, "Nothing in your inventory.");
        return 1;
	}
How to change this to dialog list?
Reply
#2

Create list[2048] in the beginning, use strcat( list, itemlist ); strcat( list, "\n" ); in loop instead of sendclientmessage and then showdialog after loop (with 'list' variable). You must be sure that maximum_inventory_items * ( maximum_item_name_length + number_of_additional_symbols) is <2048 to use in dialog.
Reply
#3

I don't understand that, Help please
Reply
#4

PHP код:
new dialogs[4500];
enum {
    
Dialog_Inventory
}
if(!
strcmp(cmdtext"/bag"true4)) {
        
dialogs[0] = 0;
        new 
itemlist128 ], itemName30 ], itemDesc100 ], itemAmmidx;
        while(
listInventoryItemsplayeriditemNameitemDescitemAmmidx )) {
               
format(itemlistsizeof(itemlist), "%s (%i)\n"itemNameitemAmm );
            
strcat(dialogstr,itemlist,sizeof(dialogstr));
            
ShowPlayerDialog(playeridDialog_InventoryDIALOG_STYLE_LIST"{00BFFF}Inventory"dialogstr"Close""");
               
idx ++;
        }
        if(!
idx) return SendClientMessage(playeridCOLOR_BLUE2"Nothing in your inventory.");
        return 
1;
    } 
Example above
Reply
#5

i will try
Reply
#6

Not work :/
Reply
#7

Anyone help ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)