GetVehicleWheelScale

From Multi Theft Auto: Wiki

This function gets the scale of all the wheels of a vehicle.

Syntax

float getVehicleWheelScale ( vehicle theVehicle )

OOP Syntax Help! I don't understand this!

Method: vehicle:getWheelScale(...)
Variable: .wheelScale
Counterpart: setVehicleWheelScale

Required Arguments

  • theVehicle: The vehicle to get its wheel scale of.

Returns

Returns the wheel scale of the specified vehicle as a decimal number, or an error if the vehicle is invalid. For more information about the returned number, see setVehicleWheelScale.

Example

Preview of the results of invoking the shrinkwheels command

This example adds a shrinkwheels command that reduces the wheel scale of a vehicle in half each time it is invoked.

addCommandHandler("shrinkwheels", function()
    local veh = getPedOccupiedVehicle(localPlayer)
    if veh then
        local newScale = getVehicleWheelScale(veh) * 0.5
        setVehicleWheelScale(veh, newScale)
        outputChatBox("Vehicle wheel scale set to " .. newScale .. ".", 0, 255, 0)
    else
        outputChatBox("You must be in a vehicle to use this command.", 255, 0, 0)
    end
end)

Requirements

Minimum supported server n/a
Minimum supported client 1.5.7-9.20642

Note: Using this function/event requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.5.7-9.20642" />

See Also

BETA: FROM VERSION 1.6 r7485 ONWARDS
BETA: FROM VERSION 1.5.8 r20797 ONWARDS
BETA: FROM VERSION 1.5.8 r20797 ONWARDS
BETA: FROM VERSION 1.5.8 r20797 ONWARDS
BETA: FROM VERSION 1.6 r7485 ONWARDS
BETA: FROM VERSION 1.5.8 r20797 ONWARDS
BETA: FROM VERSION 1.5.8 r20693 ONWARDS
BETA: FROM VERSION 1.5.8 r20726 ONWARDS