GetVehiclePlateText: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 15: Line 15:


==Example==  
==Example==  
<section name="Server" class="server" show="true">
This example outputs the text on the license plate of the vehicle the player is driving to the chatbox.
This example outputs the text on the license plate of the vehicle the player is driving to the chatbox.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 26: Line 27:
end
end
addCommandHandler( "plate", scriptPlate )
addCommandHandler( "plate", scriptPlate )
</section>
</syntaxhighlight>
</syntaxhighlight>



Revision as of 18:46, 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

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