Results 1 to 6 of 6

Thread: addmagazinepool

  1. #1

    addmagazinepool

    Trying to add magazines to the player character with the "unit addmagazinepool ["magname", count]" formula isnt working for whatever reason. when i try to use it is wants me to put a ; between the unit and addmagazinepool. if anyone knows if there is another script or something or if this is broken... let the people know.

  2. #2
    addMagazinePool is not the correct command. Perhaps you read the description of it first.

    Giving a unit, like a solider, magazines or weapons which the unit then should be able to use the correct command is addMagazine, addWeapon respectively.

  3. #3
    I shall not insult moderators DarkestKnight's Avatar
    Join Date
    Nov 27 2009
    Posts
    23
    Author of the Thread
    hmmmm, I want to add multiple magazines at one time, with one already fully loaded into its corresponding weapon. seems like a sensible idea to me. kind of like how you can have an addweaponcargo to a truck and it will put multiple weapons in at once, eh?

    with this method i have to put in ;player addmagazine "dumbeldore";player addmagazine "dumbeldore";player addmagazine "dumbeldore";player addmagazine "dumbeldore";player addmagazine "dumbeldore";player addmagazine "dumbeldore";player addmagazine "dumbeldore";player addmagazine "dumbeldore";

    to get the appropriate amount... seems ineffecient to me...
    removemagazines worked to get rid of the current multiples of ammo. see i wanted to outfit a draped sniper(not just an unarmed template soldier) with a different gun to start with, everything worked except this. i'm starting to understand how inefficient things can be. computers probably calculating repeated script commands for hundreds of soldiers at one at time.

  4. #4
    True, but I think there is no more elegant way to do it. Perhaps you like to use a "for" loop within a script:

    Code:
    for "_i" from 1 to 8 do {
       player addmagazine "dumbeldore";
    };
    Adding the weapons AFTER the magazines ensures the weapon is loaded afterwards.

  5. #5
    That or use a script.
    I believe there are tones of these by now but here's my contribution anyway

    addMagazines.sqf
    PHP Code:
    _unit _this select 0;
    _mag _this select 1;
    _count _this select 2;

    _i 0;
    while {
    _i _count} do
    {
         
    _unit addMagazine _mag;
         
    _i _i 1;
    }; 
    Then put the following into unit's init line to execute:
    PHP Code:
    [this"30Rnd_556x45_stanag"8execVM "addMagazines.sqf" 

  6. #6
    I shall not insult moderators DarkestKnight's Avatar
    Join Date
    Nov 27 2009
    Posts
    23
    Author of the Thread
    cool, thanks folks. will be checkin these out.

Posting Permissions

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