GetVehicleVariant: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">int, int getVehicleVariant ( vehicle theVehicle )</syntaxhighlight> | <syntaxhighlight lang="lua">int, int getVehicleVariant ( vehicle theVehicle )</syntaxhighlight> | ||
{{OOP||[[vehicle]]:getVariant||setVehicleVariant}} | |||
==Required Arguments== | ==Required Arguments== | ||
*'''theVehicle:''' A handle to the [[vehicle]] that you want to get the variant of. | *'''theVehicle:''' A handle to the [[vehicle]] that you want to get the variant of. |
Revision as of 22:16, 18 December 2014
This function gets the variant of a specified vehicle. In GTA SA 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 GTA SA variant list see: Vehicle variants
Syntax
int, int getVehicleVariant ( vehicle theVehicle )
OOP Syntax Help! I don't understand this!
- Method: vehicle:getVariant(...)
- Counterpart: setVehicleVariant
Required Arguments
- theVehicle: A handle to the vehicle that you want to get the variant of.
Returns
On success:
- int: An integer for the first vehicle variant see Vehicle variants
- int: An integer for the second vehicle variant see Vehicle variants
On failure:
- bool: False because the specified vehicle didn't exist
Example
Click to collapse [-]
ClientThis example tells the person in the vehicle what their vehicle variants are using: getvehvar
function getMyVehiclesVariant() local myVeh = getPedOccupiedVehicle(localPlayer) -- Get the vehicle that they're in if (myVeh) then local var1, var2 = getVehicleVariant(myVeh) -- Get the info outputChatBox("This vehicles variants: "..tostring(var1).." "..tostring(var2)) -- Output the info end end addCommandHandler("getvehvar", getMyVehiclesVariant)
Requirements
This template will be deleted.
See Also
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates