- Documentation
- Shared functions
- getVehicleHandling
Function
getVehicleHandling
Returns 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.
Syntax
table/any getVehicleHandling(vehicle vehicle [, string property = nil])Arguments
vehiclevehicle- The vehicle.
propertystring, optional = nil- Name of a single field; without it the whole table.
Returns
A table of all fields, or the value of one field (false when the field does not exist).
Example
addCommandHandler("vmax", function(player)
local vehicle = getPedOccupiedVehicle(player)
if vehicle then
outputChatBox("Vmax: " .. getVehicleHandling(vehicle, "maxVelocity") .. " km/h", player)
end
end)
See also
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.getVehicleHandlingOverridesReturns only the handling fields changed for this particular vehicle (setVehicleHandlingandsetVehicleEngine), without factory values. Useful for saving a car's tuning in a database.getOriginalHandlingReturns a model's factory handling straight from the game files (Definitive Edition handling.cfg), without any script changes. Works on both sides.