GetVehiclePlateText

From Multi Theft Auto: Wiki
Revision as of 18:46, 26 August 2007 by Norby89 (talk | contribs) (→‎Example)
Jump to navigation Jump to search

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

Click to collapse [-]
Server

This example outputs the text on the license plate of the vehicle the player is driving to the chatbox. <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>

See Also