Welcome, Guest Wednesday 16th April 2014, 05:58:14
   Home   Help Search Login Register  

OFPEC Forum

Author Topic: Disable ammo in chooper via script?  (Read 634 times)
0 Members and 1 Guest are viewing this topic.
jphilapy
*
Offline Offline


I'm a llama!


« on: 23 Dec 2005, 02:17:24 »

Hi,

I'm creating a chopper in game. I need to know how to create it without any ammo at all.

Thanks,
Jeff
Logged
Raptorsaurus
Editors Depot Staff
*****
Offline Offline



« Reply #1 on: 23 Dec 2005, 08:20:58 »

Code:
{helo removeMagazine _x} forEach (magazines helo)
Where helo is it name of the chopper who's ammo you want removed.

If you want to add back the ammo at a latter time then try this:
Code:
helo_mags = magazines helo
{helo removeMagazine _x} forEach helo_mags
then later to put the magazines back:
Code:
{helo addMagazine _x} forEach helo_mags
Logged
jphilapy
*
Offline Offline


I'm a llama!


« Reply #2 on: 23 Dec 2005, 21:19:50 »

Hi, When I use the code, I get invalid # in expression. Any idea why?

Thanks,
Jeff
Logged
Planck
Honoured
Former Staff
****
Offline Offline


I'm never wrong ....I'm just not always right !


« Reply #3 on: 23 Dec 2005, 21:50:59 »

Did you name your chopper as helo or did you give it another name?

If you gave it another name just replace helo with the name you used.

Also, it would be better to quote the error message you get.   Wink


Planck
Logged

I know a little about a lot, and a lot about a little.
Terox
Former Staff
****
Offline Offline

Follow the Sappers!


WWW
« Reply #4 on: 23 Dec 2005, 22:39:15 »


in the init field of the air unit place
removeallweapons this

or in a script use
removeallweapons heloname

will remove both weapons and ammo, if thats what you are after, that way a chopper cant rearm at a reammo truck either
« Last Edit: 23 Dec 2005, 22:41:10 by Terox » Logged

Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123
jphilapy
*
Offline Offline


I'm a llama!


« Reply #5 on: 23 Dec 2005, 23:10:46 »

Sorry the error message I get is "invalid # in expression"

or maybe "invalid number in expression".

I replaced the word helo with the word chopper1 because when I create a chopper in the mission, that is the name i give it. I am creating the chopper within the ini field of the player.

Thanks,
Jeff

Did you name your chopper as helo or did you give it another name?

If you gave it another name just replace helo with the name you used.

Also, it would be better to quote the error message you get.   Wink


Planck
Logged
jphilapy
*
Offline Offline


I'm a llama!


« Reply #6 on: 23 Dec 2005, 23:12:40 »

hi,


I tried your advice and it works for the mission. However I still like to understand the other way that is prescribed to me. As I dont want to be limited to doing only in editor things.

Thanks,
Jeff


in the init field of the air unit place
removeallweapons this

or in a script use
removeallweapons heloname

will remove both weapons and ammo, if thats what you are after, that way a chopper cant rearm at a reammo truck either
Logged
jphilapy
*
Offline Offline


I'm a llama!


« Reply #7 on: 23 Dec 2005, 23:38:11 »

Hi, quick correction. What you gave me works on 1.96. I am trying to implement code that works on 1.46. Sorry I should have stated that in the first post.

What I did so far on 1.46 is:

chopper1 removeMagazine "Rocket57x192"; Thanks for the previous post that helped me to discover this.

That works, but the foreach throws an error as I stated earlier.

Jeff


in the init field of the air unit place
removeallweapons this

or in a script use
removeallweapons heloname

will remove both weapons and ammo, if thats what you are after, that way a chopper cant rearm at a reammo truck either
Logged
Pages: [1]   Go Up
  Send this topicPrint  
 
Jump to: