ImTitanium Posted June 23, 2014 Posted June 23, 2014 Basically what I'm trying to do is use something similar to moveObject but instead of an object I'm creating a vehicle, for many reasons it's better for what I'm scripting. The below example works fine, but it's better for me to create a vehicle, it's not needed to post the whole script because I just need a tip on how to move vehicles gradually. local cargueiro = createObject ( 5291, x, y, 80 ) moveObject ( cargueiro, 60000, 2876.24316, -1719.62915, 11.04688) This is how I would like it to be, but there is no such thing as moveVehicle, at least I tried it and it didn't work. The X and Y axis have been defined previously. local cargueiro = createVehicle ( 533, x, y, 80 ) moveVehicle ( cargueiro, 60000, 2876.24316, -1719.62915, 11.04688) Is there something to move the vehicle gradually, or should I just agree with objects?
Max+ Posted June 23, 2014 Posted June 23, 2014 (edited) Edited , addEvent( "setPedControl", true ) addEventHandler( "setPedControl", root, function ( ped ) setPedControlState ( ped, "accelerate", true ) end ) addCommandHandler ( "vehb", function ( ) local x, y , z = getElementPosition ( source ) vehicle = createVehicle ( 411, x, y , z ) ped = createPed ( 230, x, y , z ) warpPedIntoVehicle ( ped, vehicle, 0 ) triggerClientEvent ( root, "setPedControl", ped ) end ) Edited June 24, 2014 by Guest
ImTitanium Posted June 23, 2014 Author Posted June 23, 2014 I can't use "setElementPosition" because it moves the element instantly, and I need the vehicle to move like there is someone piloting it, instead of the element just move instantly.
Max+ Posted June 23, 2014 Posted June 23, 2014 Oh , Sorry there is you Can Something like this , toggleControl (vehicle, "accelerate", true )
Max+ Posted June 24, 2014 Posted June 24, 2014 toggleControl is for players, not vehicles. I Know , But i event try to make another way , see my edited post,
Castillo Posted June 24, 2014 Posted June 24, 2014 @ImTitanium: You could attach the vehicle to an invisible object, and then move the object using moveObject.
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