OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started 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?
-
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?
-
Yes, fixed coordinates.
-
The following code will place an AK and one magazine in front of the player:
_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.