OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: jphilapy 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
-
{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:
helo_mags = magazines helo
{helo removeMagazine _x} forEach helo_mags
then later to put the magazines back:
{helo addMagazine _x} forEach helo_mags
-
Hi, When I use the code, I get invalid # in expression. Any idea why?
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. ;)
Planck
-
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
-
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. ;)
Planck
-
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
-
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