[Release][C#] Handling Editor

Description

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

Features

  • 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

Supported Classes

  • CHandlingData

Supported Types

  • Float
  • Vector3

Other Limitations

  • 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)

Client Commands

handling_preset
Prints the preset of the current vehicle

handling_decorators
Prints the info about decorators on the current vehicle

handling_decorators <int>
Prints the info about decorators on the vehicle with the specified int as local handle

handling_print
Prints the list of all the vehicles with any decorator of this script

handling_range <float>
Sets the specified float as the maximum distance used to refresh wheels of the vehicles with decorators

handling_debug <bool>
Enables or disables the logs to be printed in the console

Handling Presets

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

Handling Info

The 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 Min and Max allowed values and edit the Description of each field.

Config

toggleMenu=168
The Control to toggle the Menu, default is 168 which is F7 (check the controls list)

FloatStep=0.01
The step used to increase and decrease a value

ScriptRange=150.0
The max distance within which each client refreshes others clients’ vehicles

timer=1000
The value in milliseconds used by each client to check if its preset requires to be synched again

debug=false
Enables the debug mode, which prints some logs in the console

WIP

  • 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

Source
Download
I am open to any kind of feedback. Report suggestions and bugs you find.

Build

Open the 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 config.ini, the HandlingInfo.xml, the HandlingPresets.xml, the __resource.lua and a copy of a built MenuAPI

Credits

35 Likes

I have been waiting for this :heart_eyes::heart_eyes::heart_eyes:

2 Likes

About time…


+1

2 Likes

I cannot manage to get this to work. Can you help?

sure, what’s the problem?
did you extract the “handling_editor” folder in your resources folder and then started the resource?

Yes, Everytime I press F7 it doesnt do anything

Upload a CitizenFX.log

I will try, Give me a few seconds

I mean the client log in your fivem folder, to check if the scripts runs correctly. What i guess is another script disabling the f7 control, you could try editing the control in the config.ini

I tried that and it didnt work

Send the client log from fivem folder (citizenfx.log)

Neos this is a great script but I ask you a question… Will be possibile in the future to save server side an xml file to create an handling to use in addons? I mean a “save server side button”.

I could add such feature for admins. Anyway you will also be able to get the xml of the current preset printed in the console log

This is amazing :smiley: great.

I wonder if you could help, I am able to get the script to load in-game, however I seem unable to change the config key and F7 appears to make a click sound but doesn’t load the script?CitizenFX.log (105.8 KB)

mmm maybe another script is disabling that control, did you try removing all the custom scripts?

Neos-- nice work! Are you going to add the ability for printing the XML? this would help in saving a preset to be server loaded… since it appears client set presets are not server-side saved

I will add it as soon i am back working on this

Anyway it could show the current handlingId and/or handlingName you are editing. GTA 5 has the weird tendency to shorten their handling names… (i.e. CAVALCADE becomes CAVCADE in the handling.meta). These names are kind of a gotchas lol.

I could add it as description under the menu title, since it won’t be an editable field