or add the xyz rotoation to attach elements code itself.
Just edit the line 10 and 11 with this
attachElements ( weapon1, theVehicle, 0, 0, 0, 20, 30, 90 )
attachElements ( weapon2, theVehicle, 0, 1, 0, 20, 30, 90 )
Full code
local screenW,screenH = guiGetScreenSize()
local weapon1
local weapon2
function attach ( )
local theVehicle = getPedOccupiedVehicle ( localPlayer )
if theVehicle then
local x,y,z = getElementPosition ( theVehicle )
weapon1 = createWeapon("minigun", x, y, z + 1)
weapon2 = createWeapon("minigun", x, y, z + 1)
attachElements ( weapon1, theVehicle, 0, 0, 0, 20, 30, 90 )
attachElements ( weapon2, theVehicle, 0, 1, 0, 20, 30, 90 )
setWeaponClipAmmo(weapon1, 99999)
setWeaponClipAmmo(weapon2, 99999)
setWeaponState(weapon1, "firing")
setWeaponState(weapon2, "firing")
setWeaponProperty(weapon1, "fire_rotation", 0, -30, -1)
setWeaponProperty(weapon2, "fire_rotation", 0, -30, -1)
end
end
addCommandHandler ( "attach", attach )
http://i.imgur.com/G8iF23N.jpg