OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: UH60MG on 19 Jun 2008, 05:04:38

Title: Weapon on the floor [ solved ]
Post by: UH60MG on 19 Jun 2008, 05:04:38
I want an Ak74 to appear on the ground that can be picked up by the player. Is it possible in ArmA and if so how do I it?
Title: Re: Weapon on the floor
Post by: Trexian on 19 Jun 2008, 05:21:07
Do you know where you want it, as in coordinates on the map?  Or just at a place in front of the player at a certain time?
Title: Re: Weapon on the floor
Post by: UH60MG on 19 Jun 2008, 05:26:29
Yes, fixed coordinates.
Title: Re: Weapon on the floor
Post by: johnnyboy on 19 Jun 2008, 05:49:16
The following code will place an AK and one magazine in front of the player:

Code: [Select]
_type = "WeaponHolder"
_gun = "AK74"
_ammo = "30Rnd_545x39_AK"
_weapon2 = _type createVehicle [0,0,0]
_weapon2 addweaponCargo [_gun,1]
_weapon2 addmagazinecargo [_ammo,1 ]
_weapon2 setpos (player modelToWorld [0,1,0]);

Simply replace the "(player modelToWorld [0,1,0])" in the setpos line with your exact coordinates.