Jump to content
Sign in to follow this  
tryteyker

addPrimaryWeaponItem not working.

Recommended Posts

Hi,

so addPrimaryWeaponItem doesn't work for me somehow. I've tried with acc_flashlight and acc_pointer_IR, no joy. Anybody see anything wrong with this function?

TRT_FNC_SWATLD = {
_unit = _this select 0;

removeAllWeapons _unit;
removeAllAssignedItems _unit;
removeUniform _unit;
removeVest _unit;
removeHeadgear _unit;


_unit addHeadgear "H_HelmetIA";
_unit addUniform "U_I_CombatUniform_shortsleeve";
_unit addVest "V_TacVest_blk_POLICE";
nul = [_unit, "arifle_MX_Black_F",4] spawn BIS_fnc_addWeapon;
_unit addMagazines ["MiniGrenade",2];
_unit addMagazines ["SmokeShellGreen",2];
_unit addMagazine "DemoCharge_Remote_Mag";
_unit addPrimaryWeaponItem "acc_flashlight";
_unit addPrimaryWeaponItem "optic_Nightstalker";
_unit linkItem "NVGoggles_INDEP";
};

_unit is player. I also applied a flashlight manually (via supply box), and it is definitely compatible. Just the script version doesn't work.

Share this post


Link to post
Share on other sites

instead of

nul = [_unit, "arifle_MX_Black_F",4] spawn BIS_fnc_addWeapon;

Write down this

_unit addweapon 'arifle_MX_Black_F';

then add Ammo

_unit addMagazine '30Rnd_9x21_Mag';

_unit addMagazine '30Rnd_9x21_Mag';

_unit addMagazine '30Rnd_9x21_Mag';

_unit addMagazine '30Rnd_9x21_Mag';

_unit addMagazine '30Rnd_9x21_Mag';

_unit addMagazine '30Rnd_9x21_Mag';

And then write down your attachments

Share this post


Link to post
Share on other sites

There's no difference between the two commands. The function just does it quicker and more efficient.

Share this post


Link to post
Share on other sites

Just give it a try, because it might be a conflict between the "quicker" function and the normal add, as i tested it and it worked

Share this post


Link to post
Share on other sites
Just give it a try, because it might be a conflict between the "quicker" function and the normal add, as i tested it and it worked
Guys,

lower your handbags.

try this

[_unit, "arifle_MX_Black_F" ,6 ,"30Rnd_65x39_caseless_mag"] call BIS_fnc_addWeapon;

Share this post


Link to post
Share on other sites

try this

[_unit, "arifle_MX_Black_F" ,6 ,"30Rnd_65x39_caseless_mag"] call BIS_fnc_addWeapon;

Whoops its working ,

Edited by Egypt~Seal

Share this post


Link to post
Share on other sites

Doesn't fix the issue of addprimaryweaponitem not working, unfortunately.

Classic case of sleep .1 finding its use in a script. Fixed it (add a millisecond sleep before adding primary items).

Edited by tryteyker

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  

×