Jump to content

Recommended Posts

What am I missing here?

//................................
//	Ammo Box Germany
//................................

// Settings
_amountWeapon = 20;
_amountAmmo = 30;
_refreshTime = 360; // refill every 5 minutes

_this allowDamage false;

// Loop forever
while {true} do
{

// Clear box
clearWeaponCargo _this;
clearMagazineCargo _this;

// Fill box



// German Weapons
_this addWeaponCargo ["LIB_MP40", _amountWeapon];
_this addWeaponCargo ["LIB_M1908", _amountWeapon];
_this addWeaponCargo ["LIB_K98", _amountWeapon];
_this addWeaponCargo ["LIB_MG42", _amountWeapon];
_this addWeaponCargo ["LIB_MP44", _amountWeapon];
_this addWeaponCargo ["LIB_K98ZF39", _amountWeapon];
_this addWeaponCargo ["LIB_FLARE_PISTOL", _amountWeapon];
_this addWeaponCargo ["LIB_RPzB", _amountWeapon];

//Ammo
_this addMagazineCargo ["LIB_32Rnd_9x19", _amountAmmo];
_this addMagazineCargo ["lib_8rnd_9x19", _amountAmmo];
_this addMagazineCargo ["lib_5Rnd_792x57", _amountAmmo];
_this addMagazineCargo ["lib_50Rnd_792x57", _amountAmmo];
_this addMagazineCargo ["LIB_1Rnd_RPzB", _amountAmmo];
_this addMagazineCargo ["LIB_1Rnd_flare_yellow", _amountAmmo];
_this addMagazineCargo ["LIB_1Rnd_flare_green", _amountAmmo];
_this addMagazineCargo ["LIB_1Rnd_flare_red", _amountAmmo];
_this addMagazineCargo ["LIB_1Rnd_flare_white", _amountAmmo];
_this addMagazineCargo ["LIB_Ladung_Big_MINE_mag", _amountAmmo];


// Wait the duration of the timer
sleep _refreshTime;
};

Share this post


Link to post
Share on other sites

you might be over filling them (look up capacity in ammo boxes in the wiki) or you might need a slight pause before the loop.

Share this post


Link to post
Share on other sites

the stuff in the box is just the vanilla stock right ?

I dont think the script knows where to put the stuff cus _this isnt directed to anything.

U need a line - _box = _this select 0 and change all the _this to _box

in the box init - [this] exec "ammobox".sqf

not good at sqf, still learning it but i think thats ur problem..

Share this post


Link to post
Share on other sites

That did it! Now I just need to finish converting the CTF module over and add a no base attack and my TvT CTF mission will be done.

Share this post


Link to post
Share on other sites

You could just define the number of weapons being added like this:

_this addweaponcargo ["[b]M9SD[/b]", 20];
_this addmagazinecargo ["15Rnd_9x19_M9SD", 20];

Just an example of course, replace the weapon classname with one you want.

The 2nd number in the first line is the amont of that weapon being added

and the 2nd code the last number which is 20 is the amount of clips being added

so 20 clips of 15rds.

This is simpler script below:

if isnull _this exitwith {};
clearweaponcargo _this;
clearmagazinecargo _this;

_this addweaponcargo ["M9SD", 20];
_this addmagazinecargo ["15Rnd_9x19_M9SD", 20];

Just replace the modern day weapon you see there with the IF classnames,

So for every weapon you want to add just copy n paste this code:

_this addweaponcargo ["M9SD", 20];

and then replace the classname with a new one.

it will need ammo too, so for every weapon you add you need a corresponding ammo, so you need this too:

_this addmagazinecargo ["15Rnd_9x19_M9SD", 20];

============

Create a script with this tool:

http://www.armaholic.com/page.php?id=1455&highlight=ARMAEDIT

start new, choose Sqf

name the script Ammo

Copy n paste this:

if isnull _this exitwith {};
clearweaponcargo _this;
clearmagazinecargo _this;

_this addweaponcargo ["M9SD", 20];
_this addmagazinecargo ["15Rnd_9x19_M9SD", 20];

(change the classnames with IF ones)

Then in the editor in the init of the ammo box just put this code:

_dummy = this execvm "ammo.sqf";

Edited by Gnter Severloh

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  

×