Jump to content
Sign in to follow this  
Nicolas Eymerich

{_Vehicle addMagazine _x} forEach weapons _Vehicle

Recommended Posts

Here's my sqs... use this. Works great on crates, vehicles, whatever. Obviously alter the contents to your needs, create multiple .sqs files for each need.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

; Instructions:

;

; 1. In your mission directory, make a subdirectory called "reload" and put this

; script in it called "ammobox_1.sqs"

;

; 2. Make a crate in the game

;

; 3. PUt this as it's NAME:  ammo_1

;

; 4. Put this in the item's INIT field:   [ammo_1] exec "reload\ammobox_1.sqs

;

; Increment the ammobox tag for each individual box after that first one to load others

; IE: [ammo_2]... [ammo_5]...

; NOTE - This is my USA GUNS crate

; Get the crate parameter given

_crate = _this Select 0

; REMOVE STOCK ITEMS FROM THE CRATE:

ClearMagazineCargo _crate

ClearWeaponCargo _crate

; ADD THE ITEMS TO THE CRATE:

; West Weapons

;_crate addweaponcargo ["M21", 50]

;_crate addmagazinecargo ["M21", 50]

_crate addweaponcargo ["M9",100]

_crate addweaponcargo ["M9SD",100]

_crate addweaponcargo ["M16A2",100]

_crate addweaponcargo ["M16A2GL",100]

_crate addweaponcargo ["M4",100]

_crate addweaponcargo ["M4A1SD",100]

_crate addweaponcargo ["M4GL",100]

_crate addweaponcargo ["M4A1",100]

_crate addweaponcargo ["M4A1GL",100]

_crate addweaponcargo ["M4AIM",100]

_crate addweaponcargo ["M4SPR",100]

_crate addweaponcargo ["G36a",100]

_crate addweaponcargo ["g36c",100]

_crate addweaponcargo ["g36k",100]

_crate addweaponcargo ["m24",100]

_crate addweaponcargo ["mp5A5",100]

_crate addweaponcargo ["MP5SD",100]

_crate addweaponcargo ["M240",100]

_crate addweaponcargo ["M249",100]

_crate addweaponcargo ["M107",100]

_crate addmagazinecargo ["10Rnd_127x99_m107",100]

_crate addweaponcargo ["Laserdesignator",100]

_crate addweaponcargo ["Binocular",100]

_crate addweaponcargo ["NVGoggles",100]

_crate addmagazinecargo ["30Rnd_9x19_MP5",100]

_crate addmagazinecargo ["30Rnd_9x19_MP5SD",100]

_crate addmagazinecargo ["15Rnd_9x19_M9",100]

_crate addmagazinecargo ["15Rnd_9x19_M9SD",100]

_crate addmagazinecargo ["30Rnd_556x45_Stanag",100]

_crate addmagazinecargo ["30Rnd_556x45_G36",100]

_crate addmagazinecargo ["200Rnd_556x45_M249",100]

_crate addmagazinecargo ["5Rnd_762x51_M24",100]

_crate addmagazinecargo ["100Rnd_762x51_M240",100]

_crate addmagazinecargo ["1Rnd_HE_M203",100]

_crate addmagazinecargo ["Laserbatteries",100]

; East Weapons

_crate addweaponcargo ["PK",100]

_crate addmagazinecargo ["100Rnd_762x54_PK"]

_crate addweaponcargo ["SVD",100]

_crate addmagazinecargo ["10Rnd_762x54_SVD"]

Exit

Yer welcome.

Share this post


Link to post
Share on other sites

Are you talking about adding weapon CARGO or adding magazines to a vehicle's weapon? You're probably wanting:

{_vehicle addmagazine _x} foreach magazines _vehicle

This will only work properly if you haven't zeroed out the magazines in the weapon before getting in. In other words, if you fire all the ammo, then run the command, it'll work. If you put the vehicle in the editor without any ammo, i.e. setVehicleAmmo 0, then the command won't work. Not sure why.

If you want to add ammo cargo to a vehicle, then use satexas69's example.

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  

×