Jump to content
Sign in to follow this  
Nailpolish

Increase vehicleammo?

Recommended Posts

I know of the setvehicleammo command but how would I go about increasing the vehicle ammo by let's say 0.2 when a trigger activates?

Share this post


Link to post
Share on other sites

The value can't exceed 1, so you'll need to add the appropriate number of magazines instead.

Sent from my SPH-L720 using Tapatalk

Share this post


Link to post
Share on other sites
I know of the setvehicleammo command but how would I go about increasing the vehicle ammo by let's say 0.2 when a trigger activates?

this example is for the Humvees ported from arma 2

If you are runing it with a function script it may look like this

{_veh addMagazineTurret ["100Rnd_127x99_mag",[0]]} foreach [1,2,3,4];

Or if you run it directly in the vehicle init it would look like this.

{this addMagazineTurret ["100Rnd_127x99_mag",[0]]} foreach [1,2,3,4];

Of course the class of the ammo is relevant to the lines I provided.

If you need any help what so ever please inbox me. You will also need to be able to run the code/script after respawn!

Share this post


Link to post
Share on other sites
Been trying to get this work but so far no luck

Alright so this is what I think we can do

We can get the magazines of said turret pretty easy

but if we want a specific amount in the mag this will require a bit more code

so say the 32rnd 120mm we could half this to 16 by some maths

I'll post a script soonish

---------- Post added at 00:27 ---------- Previous post was at 00:14 ----------

Alright I sort of need a bit more information, so do you want a new magazine coupled with it (the engine does not allow you to put more than the default amount of bullets e.g. 30rnd Stanag can only be 30rnd not more) or just up the ammo currently in the vehicle (please not that we can't go over the default!)

Share this post


Link to post
Share on other sites

I may have been getting the class names wrong for the magazines, it's working now.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×