- Documentation
- Shared functions
- getVehicleHandlingOverrides
Function
getVehicleHandlingOverrides
Returns only the handling fields changed for this particular vehicle (setVehicleHandling and setVehicleEngine), without factory values. Useful for saving a car's tuning in a database.
Syntax
table getVehicleHandlingOverrides(vehicle vehicle)Arguments
vehiclevehicle- The vehicle.
Returns
A { field = value } table (empty when nothing changed).
Example
addEventHandler("onVehicleExit", root, function()
setElementData(source, "zapisanyHandling", toJSON(getVehicleHandlingOverrides(source)), false)
end)
See also
getVehicleHandlingReturns a vehicle's full handling as the game uses it: factory values from handling.cfg, overridden by model settings (setModelHandling), and finally by this vehicle's changes (setVehicleHandling,setVehicleEngine). Works on both sides.setVehicleHandlingChanges the driving parameters (handling) of one vehicle for every player: mass, top speed, acceleration, grip, brakes, steering, suspension and other handling.cfg fields. The game gets its own copy of the handling entry for this car, so other vehicles of the model do not change. You can pass one field with a value, a whole table of fields, ornilto go back to the factory handling (includingsetModelHandling). Field names; the list:getHandlingFieldNames.