Jump to content

Mount a minigun to a vehicle


Xwad

Recommended Posts

function posRender () 
   x, y, z = getElementPosition(localPlayer) 
   vx, vy, vz = getElementPosition(veh) 
end 
addEventHandler("onClientRender", root, posRender) 
local mini = createWeapon("minigun", vx, vy, vz+2) 
  
  
 function attaching () 
   if not isElement(mini) then 
   mini = createWeapon("minigun", vx, vy, vz + 2) 
   veh = getPedOccupiedVehicle(localPlayer) 
   else 
   destroyElement(mini) 
   end 
end 
addCommandHandler("attach", attaching) -- do /attach to make minigun or destroy it... 
  
 function wepFire() 
   if isElement(mini) then 
   fireWeapon(mini) 
   end 
end 
addCommandHandler("fire", wepFire) 

use this one, and tell me if it works... :D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...