GetVehicleType: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
{{Server client function}} | {{Server client function}} | ||
{{New feature|3|DP3| | {{New feature|3|DP3| | ||
This function retrieves the vehicle | This function retrieves the type of a vehicle (such as if it is a car or a boat). | ||
}} | }} | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string getVehicleType ( vehicle theVehicle ) | string getVehicleType ( vehicle theVehicle ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''OR''' | |||
<syntaxhighlight lang="lua"> | |||
string getVehicleType ( int modelId ) | |||
</syntaxhighlight> | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''vehicle:''' The vehicle element | *'''vehicle:''' The vehicle element to get the type of. | ||
*'''modelId:''' A vehicle model id | |||
===Returns=== | ===Returns=== | ||
Line 17: | Line 23: | ||
'''types:''' | '''types:''' | ||
Automobile | * '''Automobile''' | ||
* '''Plane''' | |||
* '''Bike''' | |||
* '''Helicopter''' | |||
* '''Boat''' | |||
* '''Train''' | |||
* '''Trailer''' | |||
* '''BMX''' | |||
* '''Monster Truck''' | |||
* '''Quad''' | |||
==Example== | ==Example== | ||
Line 26: | Line 41: | ||
==See Also== | ==See Also== | ||
{{Vehicle functions}} | {{Vehicle functions}} | ||
[[Category:Needs Example]] |
Revision as of 20:51, 14 April 2008
This function retrieves the type of a vehicle (such as if it is a car or a boat).
Syntax
string getVehicleType ( vehicle theVehicle )
OR
string getVehicleType ( int modelId )
Required Arguments
- vehicle: The vehicle element to get the type of.
- modelId: A vehicle model id
Returns
Returns a string with vehicle type or false if an invalid modelID has been supplied, or an empty string if the vehicle is blocked internally (some trailers). Works server- and clientside.
types:
- Automobile
- Plane
- Bike
- Helicopter
- Boat
- Train
- Trailer
- BMX
- Monster Truck
- Quad
Example
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