Jump to content

Recommended Posts

Posted

Tell me please why the code

let vehicle = mp.players.local.vehicle
let speed = (value / 3.6)
vehicle.setMaxSpeed(speed)

when setting the value does not work?
The speed limit doesn't work at all.
Server on version 1.1

 

  • 2 years later...
Posted

For anyone encountering this and needing a solution:

let vehicle = mp.players.local.vehicle;
let speed = parseFloat(limit/3.6);
vehicle.setMaxSpeed(speed);

speed must be parsed to float ;)

Tip: Decimating by 3.6 refers to "km/h"

  • Like 1

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