SetVehicleWheelScale
This function sets the scale of all the wheels of a vehicle. The wheel scale multiplies the visible height and length (but not width) of all the wheels in a vehicle, without affecting their collisions or the handling, similarly to setVehicleComponentScale. The wheel scale is applied after the model wheel size.
Note: Installing or removing a wheel upgrade from a vehicle resets the wheel scale to the default value. |
Tip: The default value for vehicles without wheel upgrades is 1, which renders the wheels in the model as usual. On the other hand, the default value for vehicles with a wheel upgrade is the size of the wheels in the front axle of the vehicle model. |
Syntax
bool setVehicleWheelScale ( vehicle theVehicle, float wheelScale )
OOP Syntax Help! I don't understand this!
- Method: vehicle:setWheelScale(...)
- Variable: .wheelScale
- Counterpart: getVehicleWheelScale
Required Arguments
- theVehicle: The vehicle whose wheel scale you wish to modify.
- wheelScale: The wheel scale value to set.
Returns
Returns true if the wheel scale has been set successfully, or an error if some parameter is invalid.
Example
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 server version | n/a |
---|---|
Minimum client version | 1.5.7-9.20642 |
Note: Using this feature 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
- addVehicleUpgrade
- areVehicleLightsOn
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getHeliBladeCollisionsEnabled
- getHelicopterRotorSpeed
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getVehicleAdjustableProperty
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleComponentPosition
- getVehicleComponentRotation
- getVehicleComponents
- getVehicleComponentScale
- getVehicleComponentVisible
- getVehicleController
- getVehicleCurrentGear
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleGravity
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelDummyPosition
- getVehicleModelExhaustFumesPosition
- getVehicleModelFromName
- getVehicleModelWheelSize
- getVehicleName
- getVehicleNameFromModel
- getVehicleNitroCount
- getVehicleNitroLevel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle