How to Extract values from a string ?
#1

Hi ! I'm actually scripting a shop system, where people can buy or sell some stuffs from their inventories. I'm having some problems for the buying part, as the prices and the quantities aren't always the same (setted by the seller).

So i have to extract the values from the " Menu row" they selected, to take the money, and give them the stuffs they bought.
It's hard to explain so i took a screen shot :


How can i do ?


I also add the script of the menu, dunno if it can help.
Код:
public CreateAKBulletsMenus()
{
	AK47Bullets = CreateMenu("AK47 Bullets", 2, 200.0, 100.0, 150.0, 150.0);
	new quantity[240];
	for(new i = 0; i < sizeof(SHOP); i++)
	{
if(SHOP[i][Item] == 24)
{
if(SHOP[i][Quantity] > 0)
{
				format(quantity,240,"%d x AK47 Bullets",SHOP[i][Quantity]);
AddMenuItem(AK47Bullets, 0, quantity);
				format(quantity,240,"	%d $",SHOP[i][Price]);
AddMenuItem(AK47Bullets, 1, quantity);
			}
		}
	}
	AddMenuItem(AK47Bullets, 0, "[Exit]");
}
Reply


Messages In This Thread
How to Extract values from a string ? - by Alice[WS] - 05.11.2009, 18:18
Re: How to Extract values from a string ? - by MadeMan - 05.11.2009, 19:09
Re: How to Extract values from a string ? - by Alice[WS] - 05.11.2009, 19:43
Re: How to Extract values from a string ? - by -xy! - 05.11.2009, 22:42

Forum Jump:


Users browsing this thread: 2 Guest(s)