Jump to content
Sign in to follow this  
froggyluv

Remove Magazine question

Recommended Posts

Trying to remove the UW ammo from AI divers as if they approch land they don't know enough to switch out ammo and get killed. Seems like they each start with 1 clip by default yet

this removeMagazines "20Rnd_556x45_UW_mag"

doesn't get rid of it.

Edited by froggyluv
Solved

Share this post


Link to post
Share on other sites

Try removing and giving the weapon back as well as removing the magazines. When you reassign the weapon it should have no ammo in it and require reloading at which point you could use the addMagazines to assign the correct ammo.

Try removing the weapon, all the UW magazines, adding the correct magazine and then adding the weapon back. This will remove the weapon with the incorrect ammo loaded, remove all the underwater ammo, add the correct magazine and then add the weapon in with the correct magazine loaded. Remember to add the magazine before adding the weapon to have the weapon loaded.

Commands: addMagazine, removeMagazines, removeWeapon and addWeapon.

This should do what you need it to, untested though.

this removeMagazines "20Rnd_556x45_UW_mag";
this removeWeapon "arifle_SDAR_F";
this addMagazine "30Rnd_556x45_Stanag";
this addWeapon "arifle_SDAR_F";

Share this post


Link to post
Share on other sites

Yes that does work thank you. Strangely if player starts in water, he can't access his rifle until he reaches land with the above. Not a biggie tho as I don't want underwater combat anyway :)

Share this post


Link to post
Share on other sites

Your welcome. Not sure what the no weapon access whilst underwater is I'm afraid. Can you access the inventory at all underwater? I've never honestly tried.

PS: If you edit your first post you can set the 'Solved' flag so people know this issue has been solved. :-)

Share this post


Link to post
Share on other sites

Done :)

Nope, can't access inventory while in water yet unfortunately.

Since I have your ear and Im still trying to learn basic coding, perhaps you could help me with trying to pass this on to the entire player group:

{_x this removeMagazines "20Rnd_556x45_UW_mag";
this removeWeapon "arifle_SDAR_F";
this addMagazine "30Rnd_556x45_Stanag";
this addWeapon "arifle_SDAR_F";}  forEach units group player

Edit: Just can't wrap my head around proper array handling - if i have 4 guys in my squad (a1,a2,a3,a4) -why doesn't this work?

_group = (a1,a2,a3,a4);
_group removeMagazines "20Rnd_556x45_UW_mag";
_group removeWeapon "arifle_SDAR_F";
_group addMagazine "30Rnd_556x45_Stanag";
_group addWeapon "arifle_SDAR_F";

Edited by froggyluv

Share this post


Link to post
Share on other sites
{removeallweapons _x;_x addMagazines ["30Rnd_556x45_Stanag",5];
_x addWeapon "arifle_SDAR_F"}  forEach (units group player)

Share this post


Link to post
Share on other sites

Thanks cobra! I just need to keep staring at proper syntax and pray one day it seeps in .....

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  

×