getVehiclePlateText | Multi Theft Auto: Wiki Skip to content

getVehiclePlateText

Client-side
Server-side
Shared

Pair: setVehiclePlateText

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 is used to retrieve the text on the number plate of a specified vehicle.

Syntax

getVehiclePlateText ( )

Code Examples

server

This 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

Vehicle Functions