How to add scroll down dialog
#1

Hi guys, Today I was finishing an inventory system and when I was testing the last two option is bugged, and I would like to add a scroll down how do I do it?

Attention, this system will have two languages ​​that are Portuguese and English




Код:
	if(newkeys & KEY_YES)
	{
	    new str[250], string[250];

	    format(string, sizeof string, "Item\tQuantidade\n");

	    if(LootAdd[playerid][Hamburguer] > 0)
	   	   	format(str, 200, "{FFFFFF}Hamburguer\t%d\n", LootAdd[playerid][Hamburguer]);

	    if(LootAdd[playerid][Pizza] > 0)
	   	   	format(str, 200, "%s{FFFFFF}Pizza\t%d\n", str, LootAdd[playerid][Pizza]);

	    if(LootAdd[playerid][Carne] > 0)
	   	   	format(str, 200, "%s{FFFFFF}Carne\t%d\n", str, LootAdd[playerid][Carne]);

	    if(LootAdd[playerid][Peixe] > 0)
	   	   	format(str, 200, "%s{FFFFFF}Peixe\t%d\n", str, LootAdd[playerid][Peixe]);

	    if(LootAdd[playerid][Pao] > 0)
	   	   	format(str, 200, "%s{FFFFFF}Pгo\t%d\n", str, LootAdd[playerid][Pao]);
	   	   	
	    if(LootAdd[playerid][Banana] > 0)
	   	   	format(str, 200, "%s{FFFFFF}Banana\t%d\n", str, LootAdd[playerid][Banana]);

	    if(LootAdd[playerid][Laranja] > 0)
	   	   	format(str, 200, "%s{FFFFFF}Laranja\t%d\n", str, LootAdd[playerid][Laranja]);

	    if(LootAdd[playerid][Maca] > 0)
	   	   	format(str, 200, "%s{FFFFFF}Maзг\t%d\n", str, LootAdd[playerid][Maca]);

	    if(LootAdd[playerid][Tomate] > 0)
	   	   	format(str, 200, "%s{FFFFFF}Tomate\t%d\n", str, LootAdd[playerid][Tomate]);
	   	   	
	    if(LootAdd[playerid][Abobora] > 0)
	   	   	format(str, 200, "%s{FFFFFF}Abуbora\t%d\n", str, LootAdd[playerid][Abobora]);

	    if(LootAdd[playerid][SucoDeLaranja] > 0)
	   	   	format(str, 200, "%s{FFFFFF}Suco de laranja\t%d\n", str, LootAdd[playerid][SucoDeLaranja]);

	    format(str, 250, "%sFechar Inventбrio", str);
	    strcat(string, str);
    	ShowPlayerDialog(playerid, DIALOG_INVENTARIO, DIALOG_STYLE_TABLIST_HEADERS, "Seu Inventбrio", string, "Use", "Drop");
		return 1;
	}
Reply
#2

More string capacity and it creates itself when needed.
Reply
#3

Well if the player clicks something does it have another function like , when u click hamburger u can press eat or cancel or smth like that ?
Reply
#4

Quote:
Originally Posted by ThatFag
Посмотреть сообщение
Well if the player clicks something does it have another function like , when u click hamburger u can press eat or cancel or smth like that ?
He eats the food without appearing any more options, if the player wants to close the inventory and only click on the last option, but it is bugged
Reply
#5

Quote:
Originally Posted by cdoubleoper
Посмотреть сообщение
More string capacity and it creates itself when needed.
Thanks, I put the string 250 in everything and it worked
Reply
#6

The way you are doing this is wrong, I made this as an example.

PHP код:
new string[250], tempstr[30]; // You were using 250 for both...
if(LootAdd[playerid][Hamburger] >= 1) format(tempstr, sizeof tempstr, "Hamburger:\t%d\n", LootAdd[playerid][Hamburger]);
strcat(string, tempstr);
if(
LootAdd[playerid][Pizza] >= 1) format(tempstr, sizeof tempstr, "Pizza:\t%d\n", LootAdd[playerid][Pizza]);
strcat(string, tempstr);
/* ... */ 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)