Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
DarkestKnight

addmagazinepool

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

for "_i" from 1 to 8 do {
  player addmagazine "dumbeldore";
};

Adding the weapons AFTER the magazines ensures the weapon is loaded afterwards.

Share this post


Link to post
Share on other sites

That or use a script.

I believe there are tones of these by now but here's my contribution anyway :)

addMagazines.sqf

_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:

[this, "30Rnd_556x45_stanag", 8] execVM "addMagazines.sqf"

Share this post


Link to post
Share on other sites
Sign in to follow this  

×