beamer Posted May 18, 2022 Share Posted May 18, 2022 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
Scripting Moderators xLive Posted May 19, 2022 Scripting Moderators Share Posted May 19, 2022 Hi! You can use setElementVelocity to stop the vehicle: setElementVelocity(theVehicle, 0, 0, 0) Link to comment
beamer Posted May 19, 2022 Author Share Posted May 19, 2022 10 hours ago, xLive said: Привет! Вы можете использовать setElementVelocity, чтобы остановить автомобиль: setElementVelocity(theVehicle, 0, 0, 0) big thanks friend! it works. have a nice day 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