Jump to content
Sign in to follow this  
Nebulazer

Need help with a statement in my shop script

Recommended Posts

I am trying to add a level restriction to my shop scripts that are all activated through action menu on an object. here is an example of one.

//Navid Hex
_cost=5000;

if (cash >= _cost)
then {
 cash=cash-_cost;
 hint "You Bought A Navid Hex For $5,000";
(uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: $%1",cash];
player removeWeapon (primaryWeapon player);
{player removeMagazine _x} forEach magazines player;
//Add new weapons
player addMagazine '150Rnd_93x64_Mag';
player addWeapon 'MMG_01_hex_F';
player addMagazines ['150Rnd_93x64_Mag', 3];

	}else{

	hint "Not enough money";

	};

I want to add something like this so it will work in conjunction with taking the money but I am not sure how to mix them together.

if level >= 15)
then {....
}else{

	hint "Not High Enough Level";

	};

Share this post


Link to post
Share on other sites
if (level >= 15) then {
_cost=5000;

if (cash >= _cost) then {
	cash=cash-_cost;
	hint "You Bought A Navid Hex For $5,000";
	(uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: $%1",cash];
	player removeWeapon (primaryWeapon player);
	{player removeMagazine _x} forEach magazines player;
	//Add new weapons
	player addMagazine '150Rnd_93x64_Mag';
	player addWeapon 'MMG_01_hex_F';
	player addMagazines ['150Rnd_93x64_Mag', 3];
}
else {hint "Not enough money"};
}
else {hint "Not High Enough Level"};

Share this post


Link to post
Share on other sites

Thank you very much, works like a charm!

Edited by Nebulazer

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×