Results 1 to 9 of 9

Thread: Ammo box issue

  1. #1

    Ammo box issue

    What am I missing here?

    Code:
    //................................
    //	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;
    };
    MAJ Larson
    Commanding Officer
    20th Special Forces Group
    Http://www.20thsfg.com/

  2. #2
    need to know what the problem u r getting ?

  3. #3
    Corporal
    Join Date
    Feb 6 2008
    Location
    Orlando, FL
    Posts
    79
    Author of the Thread
    The ammo boxes don't fill with the proper loads.

  4. #4
    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.

  5. #5
    Corporal
    Join Date
    Feb 6 2008
    Location
    Orlando, FL
    Posts
    79
    Author of the Thread
    Tried reducing the amounts still same effect.

  6. #6
    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..

  7. #7
    Corporal
    Join Date
    Feb 6 2008
    Location
    Orlando, FL
    Posts
    79
    Author of the Thread
    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.

  8. #8
    Could you post the working script please?

    Thanks

  9. #9
    You could just define the number of weapons being added like this:
    Code:
    _this addweaponcargo ["M9SD", 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:

    Code:
    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...light=ARMAEDIT

    start new, choose Sqf

    name the script Ammo

    Copy n paste this:
    Code:
    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:
    Code:
    _dummy = this execvm "ammo.sqf";
    Last edited by Günter Severloh; Oct 10 2012 at 22:18.

    Hosting Missions for Invasion-1944, Iron Front: Liberation 1944, & Hell in the Pacific

    WarMod Series - Massive Addon & Mod Customizable Compilation Mods for Arma1, Arma2, & Arma2CO
    WarMod | A2WarMod |A2WarModACE | COWarMod | COWarModACE | COWarModI44 |COSLX

Similar Threads

  1. Ammo Box Bug
    By [45Cdo]Kotp in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 4
    Last Post: Aug 16 2010, 15:27
  2. ammo box in a chopper
    By Staker in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 2
    Last Post: Sep 7 2009, 18:26
  3. Ammo Box Config
    By DaChevs in forum ARMA : CONFIGS AND SCRIPTING (addons)
    Replies: 3
    Last Post: Apr 12 2008, 18:07
  4. Emptying an ammo box
    By AchtungAffen in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 1
    Last Post: Apr 7 2004, 22:47
  5. AMMO BOX\'S
    By Kct in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 9
    Last Post: Dec 10 2001, 04:16

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •