SetVehiclePlateText: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 2: Line 2:
__NOTOC__
__NOTOC__
{{New feature/item|3.0133|1.3.3|5394|
{{New feature/item|3.0133|1.3.3|5394|
This function can be used to change/set the numberplate text from a car.
This function can be used to change/set the numberplate text of a car.
}}
}}



Revision as of 22:01, 30 July 2014

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

Syntax

bool setVehiclePlateText( element theVehicle, string numberplate )

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)

See Also