A script which allows to edit the handling of each vehicle individually using FiveM API and MenuAPI .
When a client edits a vehicle, it will be automatically synchronized with all the players using decorators.
The default key to open the menu is F7
- Edit the values of the handling’s fields (scroll the list or press Enter to insert custom values)
- Customizable min and max allowed values for each field
- Load presets from a server resource file
- Save and Load presets locally for each client
- Some fields don’t seem to have any effect after being edited
- Some fields require the car to move a bit or to be damaged to update after being edited
- Some Int fields have a wrong type in the ExtraNative, so I disabled them ( nInitialDriveGears )
- Flags fields aren’t supported yet
- Some of these fields above work if edited globally (but editing globally doesn’t give the smoothest experience, if more clients edit a fields in different way)
Prints the preset of the current vehicle
Prints the info about decorators on the current vehicle
Prints the info about decorators on the vehicle with the specified int as local handle
Prints the list of all the vehicles with any decorator of this script
Sets the specified float as the maximum distance used to refresh wheels of the vehicles with decorators
Enables or disables the logs to be printed in the console
HandlingPresets.xml is the file which contains the handlings you want to preload for each client. The script will load them and each client will be able to apply them to their current vehicle. I will add an option to let the client use each preset only if the model of the vehicle is the same.
NOTE: The presets require an attribute called
presetName to be loaded by the script, check the included example.
HandlingInfo.xml is the file which controls how the script handles each handling field. You can set for each field if you want it to be editable by the clients of your server by editing the
Editable field. You can also set custom
Max allowed values and edit the
Description of each field.
The Control to toggle the Menu, default is 168 which is F7 (check the controls list)
The step used to increase and decrease a value
The max distance within which each client refreshes others clients’ vehicles
The value in milliseconds used by each client to check if its preset requires to be synched again
Enables the debug mode, which prints some logs in the console
- Once FiveM API will include a GET_HANDLING_* to get the global values for each model I could avoid storing default values with decorators.
- Support for all the handling classes (once FiveM adds the support to their Natives)
- Blacklist/Whitelist for vehicle classes and/or individual vehicle models
postbuild.bat and edit the path of the resource folder. If in Debug configuration, the post build event will copy the following files to the specified path: the script, the
__resource.lua and a copy of a built MenuAPI