OFPEC Forum

Addons & Mods Depot => OFP - Addons & Mods Beta Testing => Topic started by: MattyDienhoff on 14 Nov 2004, 11:27:13

Title: weaponholder addon.
Post by: MattyDienhoff on 14 Nov 2004, 11:27:13
This is... (hopefully) a solution to a problem i've had for a long time - How to have guns just lying around on the ground. (Like when you drop them in RES but without having to drop guns everywhere) Recently, I downloaded Dan AK47's pack. And in the pack all of the guns also had "object" counterparts which were just the guns lying on the ground like someone had dropped them. I emailed him asking how he did it, and his reply is as such.

Quote
You can do it by creating a vehicle called
WeaponHolder and doing "this addweaponcargo
["M16",1]". You can also add magazines to it with
"this addmagazinecargo ["M16",(number)]" (don't want
an empty gun laying there do you?).

WeaponHolder is not visible in the editor, but you can
create it by renaming the classnames in notepad (same
way you make houses..) or making a gamelogic and
putting "somenamehere = "WeaponHolder" createVehicle
getpos this" in the init field.

I tried the last method there. (Its the only one i even have the slightest idea of) but i can't get it working. Could someone simply make an editor selectable "weaponholder" so i can just simply place one wherever i choose and put weapons in them? I searched Google, the OFPEC forum, the BIS forum and the knowledge base here at OFPEC. But i can't find anything about it. Will someone help me?
Title: Re:weaponholder addon.
Post by: Platoon Patton on 14 Nov 2004, 14:43:25
First idea is:
Code: [Select]
somenamehere  addweaponcargo ["M16",(number)] in your init .sqs instead of this...?

Title: Re:weaponholder addon.
Post by: MattyDienhoff on 15 Nov 2004, 08:05:57
I would prefer if someone who knows how would make an addon of this "weaponholder". Note what DanAK47 said
Quote
WeaponHolder is not visible in the editor, but you can
create it by renaming the classnames in notepad (same
way you make houses..)
I don't know how to do that. But i was hoping someone here did. I don't want to have to fool around in an init.sqs every single time i want to place a loose weapon somewhere.
Title: Re:weaponholder addon.
Post by: KTottE on 15 Nov 2004, 10:00:01
Here's a test version of an addon that does the job.
New objects located under Empty - Objects in the editor, they're named Weaponholder - Primary and Weaponholder - Secondary, respectively.

Use addWeaponCargo and addMagazineCargo to add weapons to them, other than being in the editor these work exactly the same as the other weaponholders.
Title: Re:weaponholder addon.
Post by: MattyDienhoff on 15 Nov 2004, 10:34:55
Great! Thanks a lot!! Primary works for pistols as well as rifles etc...
 ;D Thanks again! :cheers:

:EDIT: I got a little creative with the weaponholder and did this  :P
(http://img.photobucket.com/albums/v80/MattyDienhoff/FIAWeaponsStash.jpg)
and this...
(http://img.photobucket.com/albums/v80/MattyDienhoff/SnipersLair.jpg)