Jump to content

flip vehicle


beamer

Recommended Posts

hello please help me.

according to the example below, the flip works for me - but not the way I need it.

I need that when the player use the flip - the car is slightly above the ground, at zero coordinates (it stands exactly), and stops any movement, like a frieze, but not constant, it would immediately fall back to the ground

Thank you

 

function flip ( ) 
    local theVehicle = getPedOccupiedVehicle ( localPlayer ) 
    if ( theVehicle and getVehicleController ( theVehicle ) == localPlayer ) then 
        local rx, ry, rz = getVehicleRotation ( theVehicle ) 
         
            local x, y, z = getElementPosition ( theVehicle ) 
            setVehicleRotation ( theVehicle, rx, ry, rz ) 
            setElementPosition ( theVehicle, x, y, z + 5 ) 
        
    end 
end 
addCommandHandler("flip",flip)

function flip ( ) 
    local theVehicle = getPedOccupiedVehicle ( localPlayer ) 
    if ( theVehicle and getVehicleController ( theVehicle ) == localPlayer ) then 
        local rx, ry, rz = getVehicleRotation ( theVehicle ) 
         
            local x, y, z = getElementPosition ( theVehicle ) 
            setVehicleRotation ( theVehicle, rx, ry, rz ) 
            setElementPosition ( theVehicle, x, y, z + 5 ) 
        
    end 
end 

sorry i first time here

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