GetVehicleModelName: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|GetVehicleModelName(vehicle)}} {{FuncParameters}} {{FuncParam|vehicle|__EDIT_ME__}} {{FuncReturnV..." |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Server|1.0}} | {{Info|Function|Server|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Returns the name of the vehicle model by its ID}} | ||
{{FuncSyntax|GetVehicleModelName(vehicle)}} | {{FuncSyntax|GetVehicleModelName(vehicle)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|vehicle| | {{FuncParam|vehicle|Vehicle identifier you want to get the model name of}} | ||
{{FuncReturnValue| | {{FuncReturnValue|The name of the vehicle model. '''false''' on error.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
function getVehName(player, vehicle, seat) | |||
AddPlayerChat(player, "You've entered a " .. GetVehicleModelName(veh)) | |||
end | |||
AddEvent('OnPlayerEnterVehicle', getVehName) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{VehicleFunctions}} |
Latest revision as of 19:46, 11 October 2020
Description
Returns the name of the vehicle model by its ID
Syntax
GetVehicleModelName(vehicle)
Parameters
- vehicle
Vehicle identifier you want to get the model name of
Return Value
- The name of the vehicle model. false on error.
Example
function getVehName(player, vehicle, seat)
AddPlayerChat(player, "You've entered a " .. GetVehicleModelName(veh))
end
AddEvent('OnPlayerEnterVehicle', getVehName)
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