GetVehiclePlateText
From Multi Theft Auto: Wiki
This function is used to retrieve the text on the number plate of a specified vehicle.
Syntax
string getVehiclePlateText ( vehicle theVehicle )
OOP Syntax Help! I don't understand this!
- Method: vehicle:getPlateText(...)
- Variable: .plateText
- Counterpart: setVehiclePlateText
Required Arguments
- theVehicle: the vehicle that you wish to retrieve the plate text from.
Returns
Returns a string that corresponds to the plate on the text, false if a bad argument was passed or if it is not a vehicle. Every vehicle (including planes, boats, etc.) has a numberplate, even if it's not visible.
Example
Click to collapse [-]
ClientThis example outputs the text on the license plate of the vehicle the player is driving to the chatbox.
function outputLicensePlate ( command ) if isPedInVehicle(localPlayer) then --let's check if they're in a vehicle -- if they are in a vehicle local vehicle = getPedOccupiedVehicle ( localPlayer ) --let's get the vehicle local plateText = getVehiclePlateText ( vehicle ) --get the license plate text if plateText then -- if there was a license plate, outputChatBox ( "Your license plate is: " .. plateText )-- output it to the chatbox else outputChatBox ( "Your vehicle has no license plate." ) end else outputChatBox ( "You're not in a vehicle." ) end end -- add our function as a handler to the "plate" command addCommandHandler( "plate", outputLicensePlate )
See Also
FROM VERSION 1.5.7 r19626 ONWARDS
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getModelHandling
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
FROM VERSION 1.6 r7485 ONWARDS
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleRespawnPosition
- getVehicleRespawnRotation
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- getVehiclesOfType
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleSirens
- removeVehicleUpgrade
- resetVehicleExplosionTime
- resetVehicleIdleTime
- respawnVehicle
- setModelHandling
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
FROM VERSION 1.6 r7485 ONWARDS
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleIdleRespawnDelay
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleRespawnDelay
- setVehicleRespawnPosition
- setVehicleRespawnRotation
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition