OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mike on 13 Nov 2002, 00:24:30

Title: Make a loaded gun appear just on the ground?
Post by: Mike on 13 Nov 2002, 00:24:30
Hi the topic pretty much explains it all. I want to make it just on the ground.. as if I didnt add it to an actual object.. but preferably loaded..


and :cheers: to 1000 topics
Title: Re:Make a loaded gun appear just on the ground?
Post by: Sui on 13 Nov 2002, 01:48:37
Provided you have Resistance this is definately possible.

BIS added a couple of objects, one called "WeaponHolder" and one called "SecondaryWeaponHolder". It's these that make dropping weapons on the ground possible. So now you can use a bit of code like this:

wh1 = "WeaponHolder" createvehicle (getpos pos)
wh1 addmagazinecargo ["m16",1]; wh1 addweaponcargo ["m16",1]

To get yourself a loaded M16 lying on the ground at pos.

The "SecondaryWeaponHolder" is for adding things like LAW Launchers etc (Secondary Weapons funnily enough ;)). You can still add them to a "weaponHolder", but they stick straight up out of the ground for some reason ;D

Anyway, try that and see if it suits your purposes...
Title: Re:Make a loaded gun appear just on the ground?
Post by: Mike on 13 Nov 2002, 01:52:46
 ;D thanks ya berry much.. I wanted the player to be able to purchase weapons.. now that I can create em it should work  ;D

 :cheers: