Jump to content
Sign in to follow this  
duderide

Arma 2 Shopping script

Recommended Posts

Hi, I have been having a bit of a problem with a script I've been using. You see; i have been using BIS gun shop script. It's a simple script that allows you to walk up to an ai named saler, and buy any type of gun you want. It works great, the problem is; I am trying to make multiple gun stores across my map, so i thought this script could easily work. But then when i was copying scripts and opening the gun store folder to see how it works; i noticed that in the script it only spawns at one ammo box named box one. So the logic i have come up with to fix my problem is to copy all the scripts from the original and go inside and rename the ammo box, but this idea takes to long to fix. So I am wondering if there is a easy way to make the guns from the BIS Gun Store script, spawn at the ammo box your closes to. an example would be... ? _player is 5< then spawn gun at ammobox12, something like that maybe? i could use some pro help :D. I am now going to show a quick summary of what i just said so people that are to lazy to read my forum.

////////Main Function of script

The BIS Gun Store script spawns the guns you buy at one ammo. I need more then one.

///////Proposed Function of the script

I suggest we either use it to spawn in the player, but this mission is for MP so I need something that won't spawn on every player on the server. Or maybe a script that i can put in the ammo box that makes it spawn the weapons you buy on it, if your close to it.

Any idea helps, thanks Bohemia :D

Share this post


Link to post
Share on other sites

here is a script that, when you buy a weapon. It will be in your hand :D.

In init.sqf

money = 0

Make A Trigger

ACTIVATION : Radio Alpha

Text : Wallet

repeatedly

In Trigger Code :

Hint Format ["You have $%1", money];

Than you make a unit Name him "p1"

p1's init

p1 addaction ["Ak47 $100","buy.sqf"];

Make a buy.sqf

Code in buy.sqf

if (money < 100) then

{

Hint "You do not have enough money";

} else {

money = money -100;

player addWeapon "AK_47_M";

player addMagazine "30Rnd_762x39_AK47";

player addMagazine "30Rnd_762x39_AK47";

player addMagazine "30Rnd_762x39_AK47";

player addMagazine "30Rnd_762x39_AK47";

player addMagazine "30Rnd_762x39_AK47";

player addMagazine "30Rnd_762x39_AK47";

player addMagazine "30Rnd_762x39_AK47";

player addMagazine "30Rnd_762x39_AK47";

player addMagazine "30Rnd_762x39_AK47";

player addMagazine "30Rnd_762x39_AK47";

player addMagazine "30Rnd_762x39_AK47";

Hint "You bought this weapon";

};

Now start the game and press 0 0 and click wallet to see how much money has in your wallet.

Go near the unit and buy your weapon :D.

HOW TO ADD MONEY

money = money + 100

HOW TO REMOVE MONEY

money = money - 100

I hope this works for you :bounce3:

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  

×