OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: beefhole1 on 22 Jan 2005, 03:17:24

Title: omitting specific weapons
Post by: beefhole1 on 22 Jan 2005, 03:17:24
Hey everybody. Used to post here a long time, ago, now I'm back and the server thought it'd be fun to find my old username a different password from the one I used to have, so here I am beefhole1, not just beefhole.  ;)

Wow that was pointless. Onwards.

I know the command "removeallweapons this" in the init, I'm looking for the command that will remove a specific weapon. I've tried "removemp5a3 this" and a bunch of other combos but no luck.

While we're at it, how do you take out one weapon and add another on the same init line? I'm trying to create bodyguards using secret service skins that I dled, I want to take away the MP5s and give them a sidearm.
Title: Re:omitting specific weapons
Post by: Planck on 22 Jan 2005, 05:45:39
Try this:

unitname removeWeapon "weaponname"

and for the mags:

unitname removeMagazines "weaponname"


You can have multiple commands on the same init line by separating each command with a ';' .



Planck
Title: Re:omitting specific weapons
Post by: THobson on 22 Jan 2005, 10:47:14
The command reference also mentions a
 
unitname removeMagazine "weaponname

http://www.ofpec.com/editors/comref.php?letter=R#removeMagazine (http://www.ofpec.com/editors/comref.php?letter=R#removeMagazine)

Note the singular.  It claims to remove one magazine.  I have not tested it.
Title: Re:omitting specific weapons
Post by: Baddo on 22 Jan 2005, 11:21:32
Isn't it a bit hazardous to use those commands (removeweapon, removemagazine, removemagazines) BIS warns us about in the comref?

Just take away unit's weapons with the removeallweapons command and then give weapons and equipment you want them to have.

Much safer that way.
Title: Re:omitting specific weapons
Post by: Planck on 22 Jan 2005, 13:49:26
Very true Baddo, but

Quote
I'm looking for the command that will remove a specific weapon.

I was answering his specific question.

You only have to be careful not to end up with an invalid weapon and ammo configuration.


Planck
Title: Re:omitting specific weapons
Post by: Baddo on 22 Jan 2005, 18:10:52
OK, Planck.

:)
I'm trying to create bodyguards using secret service skins that I dled, I want to take away the MP5s and give them a sidearm.

I think he wants to change the gear right from the beginning of his mission.

If that is the case, then removeallweapons is the way to go, imho.
Title: Re:omitting specific weapons
Post by: beefhole1 on 23 Jan 2005, 02:28:23
Well, I had no choice but to use removeallweapons in the end, I couldn't find the weapon identification for the MP5. The problem I'm having now is adding magazines. Here's what I'm doing-

removeallweapons this; res1 addweapon "uzi"; res1 addmagazine "uzi"

The uzi shows up, the ammo doesn't.
Title: Re:omitting specific weapons
Post by: Homefry31464 on 23 Jan 2005, 03:32:44
I recommend adding the magazines before the weapon, otherwise you have to reload before using the weapon.
Title: Re:omitting specific weapons
Post by: beefhole1 on 23 Jan 2005, 05:00:09
Very interesting... I can get M16 ammo with the same line but not uzi ammo. Very weird.
Title: Re:omitting specific weapons
Post by: Planck on 23 Jan 2005, 05:51:06
Try "uzimag" for the magazine.

Some weapons like the M16 have the magazine with the same name.

Other weapons have 'mag' tagged on the end of the weapon name.


Planck
Title: Re:omitting specific weapons
Post by: beefhole1 on 23 Jan 2005, 07:00:51
Well Mr. Smarty pants, that did it. Thanks for the help  ;D.
Title: Re:omitting specific weapons
Post by: General Barron on 24 Jan 2005, 06:38:38
A list of all weapon/magazine names can be found here:

http://ofpec.com/editors/resource_view.php?id=499

It came from the "references" section of the ed depot.