Jump to content

[HELP] - Vehicle Speed


Recommended Posts

  • Moderators
whether I Had to make One by One every model ?

Hmmm no, with getVehicleHandling you can get the maxVelocity of the vehicle (which is the source of the onVehicleDamage event) then calculate the new maxVelocity reduced by the percentage you want to apply according to its health and then set it back using the setVehicleHandling function.

There is no difference between vehicle models you need to care of.

Link to comment
  • Moderators
then trigger maxVelocity event ?

Just stick with plain functions, why would you complicate it with the use of an event ?

Other than that, then yeah it will work.

Create a setMaxVelocity function if you want which takes 2 params: vehicle and maxVelocity.

That function will call setVehicleHandling( vehicle, "maxVelocity", maxVelocity).

Or create an updateMaxVelocity function which will only take 1 param: vehicle

That function will take its health, calculate the new velocity and then apply it to the vehicle.

You will call that updateMaxVelocity when the onVehicleDamage event is triggered

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