SetVehicleLicensePlate: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|SetVehicleLicensePlate(vehicle, text)}} {{FuncParameters}} {{FuncParam|vehicle|__EDIT_ME__}} {{Fun..." |
No edit summary |
||
Line 1: | Line 1: | ||
{{Info|Function|Server|1.0}} | {{Info|Function|Server|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Sets vehicle license plate text (up to 13 characters)}} | ||
{{FuncSyntax|SetVehicleLicensePlate(vehicle, text)}} | {{FuncSyntax|SetVehicleLicensePlate(vehicle, text)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|vehicle| | {{FuncParam|vehicle|Vehicle identifier of vehicle which you wish to change license plate text}} | ||
{{FuncParam|text| | {{FuncParam|text|New license plate text}} | ||
{{FuncReturnValue| | {{FuncReturnValue|This function has no return value}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
function cmd_lp(player, ...) | |||
local message = table.concat({...}, " ") | |||
if (#{...} == 0) then | |||
return AddPlayerChat(player, "Usage: /lp <new license plate text>") | |||
end | |||
local vehicle = GetPlayerVehicle(player) | |||
if (vehicle == 0) then | |||
return AddPlayerChat(player, '<span color="#ff0000ee">You must be in a vehicle!</>') | |||
end | |||
if (GetPlayerVehicleSeat(player) ~= 1) then | |||
return AddPlayerChat(player, "You must be the driver of the vehicle") | |||
end | |||
SetVehicleLicensePlate(vehicle, message) | |||
end | |||
AddCommand("lp", cmd_lp) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{VehicleFunctions}} |
Revision as of 14:45, 12 August 2019
Description
Sets vehicle license plate text (up to 13 characters)
Syntax
SetVehicleLicensePlate(vehicle, text)
Parameters
- vehicle
Vehicle identifier of vehicle which you wish to change license plate text - text
New license plate text
Return Value
- This function has no return value
Example
function cmd_lp(player, ...)
local message = table.concat({...}, " ")
if (#{...} == 0) then
return AddPlayerChat(player, "Usage: /lp <new license plate text>")
end
local vehicle = GetPlayerVehicle(player)
if (vehicle == 0) then
return AddPlayerChat(player, '<span color="#ff0000ee">You must be in a vehicle!</>')
end
if (GetPlayerVehicleSeat(player) ~= 1) then
return AddPlayerChat(player, "You must be the driver of the vehicle")
end
SetVehicleLicensePlate(vehicle, message)
end
AddCommand("lp", cmd_lp)
See also
- CreateVehicle
- DestroyVehicle
- IsValidVehicle
- GetVehicleCount
- GetAllVehicles
- GetVehicleModel
- GetVehicleModelName
- SetVehicleRespawnParams
- IsVehicleStreamedIn
- GetStreamedVehiclesForPlayer
- GetStreamedVehicles
- SetVehicleLocation
- GetVehicleLocation
- SetVehicleRotation
- GetVehicleRotation
- SetVehicleHeading
- GetVehicleHeading
- SetVehicleHealth
- GetVehicleHealth
- SetVehicleLicensePlate
- GetVehicleVelocity
- GetVehicleDriver
- GetVehiclePassenger
- GetVehicleNumberOfSeats
- SetVehicleColor
- GetVehicleColor
- SetVehicleLinearVelocity
- SetVehicleAngularVelocity
- GetVehicleGear
- SetVehicleHoodRatio
- GetVehicleHoodRatio
- SetVehicleTrunkRatio
- GetVehicleTrunkRatio
- StartVehicleEngine
- StopVehicleEngine
- GetVehicleEngineState
- SetVehicleLightEnabled
- GetVehicleLightState
- SetVehicleDamage
- GetVehicleDamage
- AttachVehicleNitro