getVehicleModelWheelSize | Multi Theft Auto: Wiki Skip to content

getVehicleModelWheelSize

Client-side
Server-side
Shared

Pair: setVehicleModelWheelSize

Manual Review Required

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


This function gets the size of a group of wheels for a vehicle model.

OOP Syntax Help! I don't understand this!

Syntax

float|table getVehicleModelWheelSize ( int vehicleModel, string wheelGroup )
Required Arguments
  • vehicleModel: The vehicle model ID.
  • wheelGroup: The group of wheels of the vehicle model to retrieve their size value. If not specified, it defaults to all_wheels . The following values are supported: front_axle : Represents the wheels in the front axle. rear_axle : Represents the wheels in the rear axle. all_wheels : Convenience group that returns all the wheel sizes in a table of the following format:

Returns

  • float|table: value

Returns a decimal number or a table, depending on the specified wheel group. If the specified vehicle model ID or wheel group are not valid, an error is raised instead. The meaning of the wheel size values is documented in setVehicleModelWheelSize .

Code Examples

shared

This example adds ahovermecommand that exploits the fact that the wheel size changes the ground clearance of a vehicle model to make it hover over the ground.

addCommandHandler("hoverme", function()
local veh = getPedOccupiedVehicle(localPlayer)
if veh then
local vehicleId = getElementModel(veh)
local currentSizes = getVehicleModelWheelSize(vehicleId)
setVehicleModelWheelSize(vehicleId, "front_axle", currentSizes.front_axle * 2)
setVehicleModelWheelSize(vehicleId, "rear_axle", currentSizes.rear_axle * 2)
outputChatBox("Vehicle model wheel size doubled!", 0, 255, 0)
else
outputChatBox("You must be in a vehicle to use this command.", 255, 0, 0)
end
end)

See Also

Vehicle Functions