SetVehiclePlateText

From Multi Theft Auto: Wiki
Revision as of 19:24, 6 February 2015 by Lopez (talk | contribs) (added info about issue #8158)
Jump to navigation Jump to search

This function can be used to change/set the numberplate text of a car.

Syntax

bool setVehiclePlateText( element theVehicle, string numberplate )

OOP Syntax Help! I don't understand this!

Method: vehicle:setPlateText(...)
Variable: .plateText
Counterpart: getVehiclePlateText


Required Arguments

  • theVehicle: the vehicle whose numberplate you want to change.
  • numberplate: a string that will go on the number plate of the car (max 8 characters).

Returns

Returns true if the numberplate was changed successfully, or false if invalid arguments were passed

Requirements

This template will be deleted.

Example

function PlateText(thePlayer,commandName,text)
	local Vehicle = getPedOccupiedVehicle(thePlayer)
	if Vehicle then
		if text then
			setVehiclePlateText( Vehicle, text )
		else
			outputChatBox("You must enter a message.",thePlayer)
		end
	else
		outputChatBox("You must be in a Vehicle.",thePlayer)
	end
end
addCommandHandler("setplate",PlateText)

Issues

Issue ID Description
#8158 setVehiclePlateText doesn't seem to change visual plate texture on most (if not all) motorcycles.

See Also