About Dialog - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: About Dialog (
/showthread.php?tid=580315)
About Dialog [HELP +REP] -
MasonSFW - 04.07.2015
Код:
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?
Re: About Dialog -
prineside - 04.07.2015
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.
Re: About Dialog -
MasonSFW - 04.07.2015
I don't understand that, Help please
Re: About Dialog -
Prokill911 - 04.07.2015
PHP код:
new dialogs[4500];
enum {
Dialog_Inventory
}
if(!strcmp(cmdtext, "/bag", true, 4)) {
dialogs[0] = 0;
new itemlist[ 128 ], itemName[ 30 ], itemDesc[ 100 ], itemAmm, idx;
while(listInventoryItems( playerid, itemName, itemDesc, itemAmm, idx )) {
format(itemlist, sizeof(itemlist), "%s (%i)\n", itemName, itemAmm );
strcat(dialogstr,itemlist,sizeof(dialogstr));
ShowPlayerDialog(playerid, Dialog_Inventory, DIALOG_STYLE_LIST, "{00BFFF}Inventory", dialogstr, "Close", "");
idx ++;
}
if(!idx) return SendClientMessage(playerid, COLOR_BLUE2, "Nothing in your inventory.");
return 1;
}
Example above
Re: About Dialog -
MasonSFW - 04.07.2015
i will try
Re: About Dialog -
MasonSFW - 04.07.2015
Not work :/
Re: About Dialog -
MasonSFW - 04.07.2015
Anyone help ?