GetVehiclePlateText: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Server client function}} | {{Server client function}} | ||
__NOTOC__ | __NOTOC__ | ||
This function is used to retrieve the text on the number plate of a specified vehicle. | |||
This | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string getVehiclePlateText ( vehicle theVehicle ) | string getVehiclePlateText ( vehicle theVehicle ) | ||
Line 11: | Line 9: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle:''' A handle to the vehicle that you wish to retrieve the plate text from. | |||
*''' | |||
===Returns=== | ===Returns=== | ||
Returns a ''string'' that coresponds to the plate on the text or ''false'' if a bad argument was passed or if the vehicle is not a car. | |||
==Example== | ==Example== | ||
This example outputs the text on the license plate of the vehicle the player is driving to the chatbox. | |||
This example | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function scriptPlate ( player, command ) | |||
local aVehicle = getPlayerOccupiedVehicle ( getLocalPlayer() ) | |||
local text = getVehiclePlateText ( aVehicle ) | |||
if ( text and aVehicle ) then | |||
outputChatBox ( "text" ) | |||
else outputChatBox ( "your vehicle has no licence plate or you're not in a vehicle" ) | |||
end | |||
end | |||
addCommandHandler( "plate", scriptPlate ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Vehicle functions}} | ||
Revision as of 18:41, 26 August 2007
This function is used to retrieve the text on the number plate of a specified vehicle.
Syntax
string getVehiclePlateText ( vehicle theVehicle )
Required Arguments
- theVehicle: A handle to the vehicle that you wish to retrieve the plate text from.
Returns
Returns a string that coresponds to the plate on the text or false if a bad argument was passed or if the vehicle is not a car.
Example
This example outputs the text on the license plate of the vehicle the player is driving to the chatbox.
function scriptPlate ( player, command ) local aVehicle = getPlayerOccupiedVehicle ( getLocalPlayer() ) local text = getVehiclePlateText ( aVehicle ) if ( text and aVehicle ) then outputChatBox ( "text" ) else outputChatBox ( "your vehicle has no licence plate or you're not in a vehicle" ) end end addCommandHandler( "plate", scriptPlate )
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