OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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.
-
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
-
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.
-
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.
-
Very true Baddo, but
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
-
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.
-
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.
-
I recommend adding the magazines before the weapon, otherwise you have to reload before using the weapon.
-
Very interesting... I can get M16 ammo with the same line but not uzi ammo. Very weird.
-
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
-
Well Mr. Smarty pants, that did it. Thanks for the help ;D.
-
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.