Jump to content
Sign in to follow this  
Shinra123

Need help with Inventory commands

Recommended Posts

Hi some of the unit addons that I have downloaded don't have Radios in the inventory's. So I would like some help adding Radios to the inventory's of my AI allies and enemy's. Could someone tell me the initialization command to adding Radios to inventory's.

Share this post


Link to post
Share on other sites

In your init.sqf...or from anywhere really... once all the units are initialized and on the map... execute this little script.

littlescript.sqf:-

_allunits = allunits;

for "_i" from 0 to (count _allunits)-1 do {
_unit = _allunits select _i;
if (not (_unit hasWeapon "ItemRadio")) then {_unit addWeapon "ItemRadio"};
sleep 0.01;
};

EDIT:

Another way to make the purists happy!

littlescript.sqf:-

_allunits = allunits;
{if (not (_x hasWeapon "ItemRadio")) then {_x addWeapon "ItemRadio"}} foreach _allunits;

Edited by twirly

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  

×