Jump to content

Move vehicles gradually


Recommended Posts

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?

Link to comment

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