Dialog inventory
#1

Hello, I'm currently trying to create a dialog that shows the items that you have in your inventory after pressing a key, here's what I have

Код:
if (PRESSED(KEY_YES))
{
	new dialogstr[562];
	if(UserData[playerid][sItem1] > 0) return strcat(dialogstr, ""W"Item1:\t%d\n", UserData[playerid][sItem1]);
	if(UserData[playerid][sItem2] > 0) return strcat(dialogstr, ""W"Item2:\t%d\n", UserData[playerid][sItem2]);
	else SendClientMessage(playerid, -1, ""W"You don't have anything in your inventory");
	ShowPlayerDialog(playerid, DIALOG_INVENTORY, DIALOG_STYLE_TABLIST_HEADERS, ""COLORSV"Inventory", dialogstr, ""W"Select", ""W"Cancel");
}
However, nothing happens after pressing the key. If you don't have anything it does display the message, but if you have at least 1 item, the dialog doesn't show up.

I've also tried using format instead of strcat, but I get the same result. I don't want the dialog to show up items that you don't have, so is there another way to do this?

Thanks!
Reply


Messages In This Thread
Dialog inventory - by Cepillado300 - 01.05.2015, 21:45
Re: Dialog inventory - by DRCharlie - 01.05.2015, 22:01
Reply: Dialog inventory - by Cepillado300 - 01.05.2015, 23:47

Forum Jump:


Users browsing this thread: 1 Guest(s)