ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getVehicleHandling

Function

getVehicleHandling

Server and clientVehiclesIdentical to MTA:SA

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