getVehicleHandling | Multi Theft Auto: Wiki Skip to content

getVehicleHandling

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function returns a table of the current vehicle handling data.

OOP Syntax Help! I don't understand this!

  • Method:vehicle:getHandling(...)
  • Variable: .handling

Syntax

mixed getVehicleHandling ( element theVehicle, string property )
Required Arguments
  • theVehicle: the vehicle you wish to get the handling data of.
  • property: MISSING_PARAM_DESC

Returns

  • mixed: value

Returns a table containing all the handling data, false otherwise. If a property is specified, it returns the value of the specific property. Here's a list of valid table properties and what they return:

Code Examples

shared

This example creates a new function called getVehicleHandlingProperty, which simulates the previous syntax of this function.

function getVehicleHandlingProperty ( element, property )
if isElement ( element ) and getElementType ( element ) == "vehicle" and type ( property ) == "string" then -- Make sure there's a valid vehicle and a property string
local handlingTable = getVehicleHandling ( element ) -- Get the handling as table and save as handlingTable
local value = handlingTable[property] -- Get the value from the table
if value then -- If there's a value (valid property)
return value -- Return it
end
end
return false -- Not an element, not a vehicle or no valid property string. Return failure
end

See Also

Vehicle Functions