SetVehiclePlateText: Difference between revisions
Jump to navigation
Jump to search
UniOnDennis (talk | contribs) (Created page with "{{Server client function}} __NOTOC__ {{New feature/item|3.0140|1.3.3|5394| This function can be used to change/set the numberplate text from a car. }} ==Syntax== <syntaxhighlight lang="lua"> f...") |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
(16 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | |||
{{Server client function}} | {{Server client function}} | ||
This function can be used to set the numberplate text of a vehicle. | |||
All non ascii characters will be replaced by spaces. | |||
This function can be used to | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setVehiclePlateText( element theVehicle, string numberplate ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[vehicle]]:setPlateText|plateText|getVehiclePlateText}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle:''' | *'''theVehicle:''' the [[vehicle]] whose numberplate you want to change. | ||
*'''numberplate:''' | *'''numberplate:''' a string that will go on the number plate of the vehicle (max 8 characters). | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the numberplate was changed successfully, or ''false'' if invalid arguments were passed | Returns ''true'' if the numberplate was changed successfully, or ''false'' if invalid arguments were passed | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
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 or the plate is incorrect.",thePlayer) | |||
end | |||
else | |||
outputChatBox("You must be in a Vehicle.",thePlayer) | |||
end | |||
end | |||
addCommandHandler("setplate",PlateText) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Vehicle_functions}} | {{Vehicle_functions}} |
Latest revision as of 17:11, 7 November 2024
This function can be used to set the numberplate text of a vehicle. All non ascii characters will be replaced by spaces.
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 vehicle (max 8 characters).
Returns
Returns true if the numberplate was changed successfully, or false if invalid arguments were passed
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 or the plate is incorrect.",thePlayer) end else outputChatBox("You must be in a Vehicle.",thePlayer) end end addCommandHandler("setplate",PlateText)
See Also
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates