Jump to content

Plane weapon


Xwad

Recommended Posts

Hi. I made a script that attaches an m4 to the stuntplane and shoot with it like with the rustler. I started the rescource bu its not working.

Client.lua

  
function createM4Weapon() 
    local vX, vY, vZ = getElementPosition(getPedOccupiedVehicle(localPlayer)) 
    if getElementModel(source) == 513 then 
        local weapon = createWeapon("m4", vx, vy, vz + 1) 
        setWeaponClipAmmo(weapon, 99999) 
        setWeaponState(weapon, "ready") 
        addEventHandler("onClientKey", root,  
            function(button,state) 
                if button == "lctrl" and state == true then 
                    fireWeapon(m4) 
                end 
            end) 
    end 
end 
addEventHandler( "onVehicleEnter", createM4Weapon) 
  

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...