Help with list
#1

I want to create textdrawed buy list but
it shows only one item to buy

/imageshack/img697/1395/samp002bp.png

if i do the same with sendclientmessage it will show example:
Shotgun Round, xx$
Shotgun, xx$
Deagle Clip, xx$
Deagle, xx$
Text Version, works alright
Код:
		if(cmdcount < 2)
		{
			//generate product list
			for(new i = 0; i < MAX_PRODUCTS; i++)
			{
				if(ProductInfo[busid][i][prSQLId] != INVALID_SQL_ID)
				{
					if(ProductInfo[busid][i][prFlags] & BUYABLE_PRODUCT)
					{
						format(string, sizeof(string),"%s, $%.2f", BaseProductInfo[ProductInfo[busid][i][prSQLId]][bpName],
						 	FloatMoney(ProductInfo[busid][i][prBuyPrice]));
						SendClientMessage(playerid, COLOR_GREY, string);
					}
				}
			}
			SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /buy [name/id] [amount=1]");
			return 1;
		}
Textdraw Version
Код:
		if(cmdcount < 2)
		{
			//generate product list
			for(new i = 0; i < MAX_PRODUCTS; i++)
			{
				if(ProductInfo[busid][i][prSQLId] != INVALID_SQL_ID)
				{
					if(ProductInfo[busid][i][prFlags] & BUYABLE_PRODUCT)
					{
						format(string, sizeof(string),"%s, $%.2f~n~", BaseProductInfo[ProductInfo[busid][i][prSQLId]][bpName],
				 	  FloatMoney(ProductInfo[busid][i][prBuyPrice]));
						ShowPlayerInformation(playerid, "Buy menu", string, "_", "_", 0, 0);
					}
				}
			}
			SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /buy [name/id] [amount=1]");
			return 1;
		}
Reply
#2

anyone?
Reply
#3

I don't have much time, so try to manage and get it working by using/seeing this http://forum.sa-mp.com/index.php?topic=179361.0.
Reply
#4

Not sure exactly what ShowPlayerInformation does, but try this:
You may need to increase the size of your string var to something like 512 or 1024 just to be safe.

Код:
		if(cmdcount < 2)
		{
			//generate product list
			for(new i = 0; i < MAX_PRODUCTS; i++)
			{
				if(ProductInfo[busid][i][prSQLId] != INVALID_SQL_ID)
				{
					if(ProductInfo[busid][i][prFlags] & BUYABLE_PRODUCT)
					{
						format(string, sizeof(string),"%s%s, $%.2f~n~", string, BaseProductInfo[ProductInfo[busid][i][prSQLId]][bpName],
				 	  FloatMoney(ProductInfo[busid][i][prBuyPrice]));
					}
				}
			}
            ShowPlayerInformation(playerid, "Buy menu", string, "_", "_", 0, 0);
			SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /buy [name/id] [amount=1]");
			return 1;
		}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)