Help with list - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with list (
/showthread.php?tid=155987)
Help with list -
armyoftwo - 20.06.2010
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;
}
Re: Help with list -
armyoftwo - 21.06.2010
anyone?
Re: Help with list -
russo666 - 21.06.2010
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.
Re: Help with list -
ledzep - 21.06.2010
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;
}