getVehicleVariant | Multi Theft Auto: Wiki Skip to content

getVehicleVariant

Client-side
Server-side
Shared

Pair: setVehicleVariant

This page is incomplete! Help wanted!

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


This function gets the variant of a specified vehicle. In GTA: San Andreas some vehicles are different; for example the labelling on trucks or the contents of a pick-up truck and the varying types of a motor bike. For the default variant list see: Vehicle variants.

Syntax

getVehicleVariant ( )

Code Examples

server

This example tells theplayerin thevehiclewhat their vehicle variants are with a command namedgetvehvar:

function getMyVehicleVariants()
local myVeh = getPedOccupiedVehicle(localPlayer) -- Get the vehicle that the player is in
if myVeh then
local variant1, variant2 = getVehicleVariant (myVeh) -- Get the vehicle variants
outputChatBox ("This vehicle's variants are: "..tostring (variant1).." "..tostring (variant2)) -- Output the info to chatbox
end
end
addCommandHandler ("getvehvar", getMyVehicleVariants)

See Also

Vehicle Functions