Limit the vehicle speed per class

Hey !

It’s a simple script where you can define a max speed limit for the different vehicle classes ( kmh or mph ) and if the vehicle goes above the set limit the engine is turned off and killed ( I think it’s only useful for “admin” purposes, to avoid people changing their top speed, or if you wanna set a server top speed limit, idk )

Someone asked me to do it for them and i figured it could be useful for some people so I’m putting the link to get it ( free ) : GitHub link

Enjoy !

[EDIT - 12/07/2024]
New update is out !

Content :

  • Can now turn off the script is the config
  • Custom Classes added ( explained in the config )

Bugs I noticed :

  • script not compatible with a “realistic car failure” ( not sure if it’s not working with any of the scripts doing that kind of effect but I know it wasn’t working with the one I added on my server [ I’m using iEnsomatic RealisticVehicleFailure created by Jens Sandalgaard ] )
  • Setting the vehicle Engine Hp at -100.00 would cause vehicles to get on fire, meaning the vehicle would explode after seconds, which is not what we’re looking for, the hp is now set at 0.00

If you’re encountering any issues make sure to reply !

[EDIT - 13/07/2024]

  • Added a warning system ( Basically giving a chance to the players to slow down before shutting down the engine
  • Some optimization to make it more resource efficient
  • new settings in the config as well

link does not work

1 Like

my bad i put hre instead of href in the link tag ! It’s fixed !

Can I change classes to A, B, C, D, E S class?

The numbers representing the classes are set by the game, we cant change them

Or

You could create a custom array with like A = 100 instead of [1] = 100
And the create an other Config subarray to set which vehicle is associated to what class ( example A = {“primo”, “panto”, “t20”}
Then in the client loop instead of getting the real class you would first get the hash key of your vehicle and check if it exists in the newly created subarray with the list of your vehicles and if it exists get the index ( in tyis case you’d get A ) and from there to get the limit you just use the found index to get the limit associated with it in the Config.Classes (dont forget to handle errors in case the vehicle isnt find, meaning no limit )

Actually i think im gonna do it, it’s a nice feature to add

New update is out !

Content :

  • Can now turn off the script is the config
  • Custom Classes added ( explained in the config )

Bugs I noticed :

  • script not compatible with a “realistic car failure” ( not sure if it’s not working with any of the scripts doing that kind of effect but I know it wasn’t working with the one I added on my server [ I’m using iEnsomatic RealisticVehicleFailure created by Jens Sandalgaard ] )
  • Setting the vehicle Engine Hp at -100.00 would cause vehicles to get on fire, meaning the vehicle would explode after seconds, which is not what we’re looking for, the hp is now set at 0.00

If you’re encountering any issues make sure to reply !

can easily modify most car Handling meta files… i’m attempting to work on the GTA cars to see if i can modify their meta through a similar way to ‘add-on/FiveM’ Ready car dev things… but this idea isnt to bad… would be fun to test out

Modify the meta files to set a new max speed limit you mean ?

Actually with this script I’m not really taking into account the vehicle data because you can use it in different ways; either as a “normal” speed limit setter or as a kind of “security” on the server ( what i mean is blocking players cheating the speed of their cars )

New update out ( again ! )

  • Added a warning system ( Basically giving a chance to the players to slow down before shutting down the engine
  • Some optimization to make it more resource efficient
  • new settings in the config as well