Military Guy Posted November 6, 2020 Share Posted November 6, 2020 (edited) How to rotate missile? I attach missile to Packer, works. Help pls, im need the missile to fly at an angle function shootProjectile() local vehicle = getPedOccupiedVehicle(localPlayer) -- Only create projectile if we are inside a SWAT if(vehicle) and getVehicleModel(vehicle) == 443 then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z+2) end end function toggleDemControls(bool) toggleControl ( "vehicle_fire", bool ) toggleControl ( "vehicle_secondary_fire", bool) end function swatEnter (player) if player ~= localPlayer then return end local vehicle = getPedOccupiedVehicle(localPlayer) if getElementModel (vehicle) == 443 then toggleDemControls(false) bindKey("vehicle_fire", "down", shootProjectile) bindKey("vehicle_secondary_fire", "down", shootProjectile) end end addEventHandler ( "onClientVehicleEnter", root, swatEnter ) -- enable vehicle fire when player exits the SWAT, or when he dies -- so he can use hunter or anything else. function enableVehicleFireIfDead () if source ~= localPlayer then return end toggleDemControls(true) end function swatExit (player) if player ~= localPlayer then return end toggleDemControls(true) end addEventHandler ( "onClientVehicleExit", root, swatExit ) addEventHandler ( "onClientPlayerWasted", root, enableVehicleFireIfDead ) Edited November 6, 2020 by Military Guy Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now