GetVehicleLicensePlate: Difference between revisions

From Onset Developer Wiki
No edit summary
 
Line 11: Line 11:


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua>
AddCommand("getlicenseplate", function(playerid)
    local vehicle = GetPlayerOccupiedVehicle(playerid)
    if vehicle == 0 then
        return AddPlayerChat(playerid, "You must be in a vehicle!")
    end
 
    local plate = GetVehicleLicensePlate(vehicle)
    return AddPlayerChat(playerid, "The license plate of this vehicle is: " .. plate)
end)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
{{VehicleFunctions}}
{{VehicleFunctions}}

Latest revision as of 15:10, 27 May 2021

GetVehicleLicensePlate

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Gets the vehicle license plate text.

Syntax

GetVehicleLicensePlate(vehicle)

Parameters

  • vehicle
    The vehicle identifier.

Return Value

  • Returns the license plate text as a string.

Example

AddCommand("getlicenseplate", function(playerid)
    local vehicle = GetPlayerOccupiedVehicle(playerid)
    if vehicle == 0 then
        return AddPlayerChat(playerid, "You must be in a vehicle!")
    end

    local plate = GetVehicleLicensePlate(vehicle)
    return AddPlayerChat(playerid, "The license plate of this vehicle is: " .. plate)
end)

See also