OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: minimilo on 06 May 2004, 18:42:09
-
when i place ammo crates, how do i make certain weapons and ammo appear in them, (what is the code, and wot box do i put it in??)
cheers
-
Check out the commands addmagazinecargo and addweaponcargo in your comref. :)
:beat: *Gets Shot* :beat:
-
soz bout dis im kinda new, what is comref, also, can i give a soldier a weapon just like ammo crates,
cheers
-
to add a weapon to a ammo box, put this into it's init field:
this addweaponcargo ["M16",5]; this addmagazinecargo ["M16",5]
this will add 5 M16's and 5 M16 mags.
To add a weapon to a soldier, use this:
removeallweapons this; this addmagazine "M16"; this addmagazine "M16"; this addmagazine "M16"; this addmagazine "M16"; this addweapon "M16
this will remove all of the soldiers previous weapon, and then add 4 M16 mags and a M16 gun.
The comref is the official command reference. This is a list of all the scripting commands that can be used in the game. I siggest looking in the editors depot for tutorial on scripting and mission editing.
-
Hey minimilo!
Check out this page (http://www.ofpec.com/editors/browse.php?browsewhat=2&category=2_8) and you will see an ammocrate filler script. You can also do this manually. Look on this page (http://www.ofpec.com/editors/comref.php?letter=A) and scroll down to "addweapon" and "addmagazine". Be sure to read the comments under these commands as they contain some useful info.
Wadmann
-
thnx ppl
-
ive put in what it says, an "unknown operator" cums up
-
What exactly have did you put in ???
EDIT
if you put in what I said, then it's wrong. I made a mistake while typing it. Here's how it should look:
removeallweapons this; this addmagazine "M16"; this addmagazine "M16"; this addmagazine "M16"; this addmagazine "M16"; this addweapon "M16"