Jump to content

Car Rockets Rotation Problem


Recommended Posts

Hi guys .

I want to ask a question that the rockets are not firing on a fixed position

when ever i change the vehicle's direction ,then the rockets firing source position also change from one headlight to another

this is the script

i also tried use setelement rotation but it didnt worked If someone can help me i will be thank full to him

i created two different different rockets binded by mouse clicks

  
  
  
function carshoot() 
    if bindTrigger == 1 then 
        if not isPedDead(cLP) then 
            bindTrigger = 0 
            local x,y,z = getElementPosition(theVehicle) 
            local rX,rY,rZ = getElementRotation(theVehicle) 
            local x = x+1 
            local y = y+1 
            createProjectile(theVehicle, 19, x-2, y, z, 1.0, nil) 
            setTimer(allowShoots,4000, 1) 
        end 
    end 
end 
  
  
function carshoot2() 
    if bindTrigger2 == 1 then 
        if not isPedDead(cLP) then 
        bindTrigger2 = 0 
            local x,y,z = getElementPosition(theVehicle) 
            local rX,rY,rZ = getElementRotation(theVehicle) 
            local x = x+1 
            local y = y+1 
            createProjectile(theVehicle, 19, x, y, z, 1.0, nil) 
            setTimer(allowShoots,4000, 1) 
        end 
    end 
end 
  

Link to comment

Try this one

function carshoot2() 
    if bindTrigger2 == 1 then 
        if not isPedDead(cLP) then 
            local vehicle = getPedOccupiedVehicle(localPlayer) 
            if(vehicle) then 
            bindTrigger2 = 0 
            local x,y,z = getElementPosition(vehicle) 
            local rx,ry,rz = getElementRotation(vehicle) 
            createProjectile(vehicle, 19, x+1, y+1, z, 1.0, nil,rx,ry,rz) 
            setTimer(allowShoots,4000, 1) 
            end 
        end 
    end 
end  

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