GetAllVehicles: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|GetAllVehicles()}} {{FuncParameters}} {{FuncNoParam}} {{FuncReturnValue|__EDIT_ME__}} == Example..." |
No edit summary |
||
Line 1: | Line 1: | ||
{{Info|Function|Server|1.0}} | {{Info|Function|Server|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Get all the vehicle identifiers in a table.}} | ||
{{FuncSyntax|GetAllVehicles()}} | {{FuncSyntax|GetAllVehicles()}} | ||
Line 8: | Line 8: | ||
{{FuncNoParam}} | {{FuncNoParam}} | ||
{{FuncReturnValue| | {{FuncReturnValue|This function returns a table with valid vehicle identifiers.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang='Lua'> | |||
for k, v in pairs(GetAllVehicles()) do | |||
SetVehicleColor(v, RGB(255, 0, 0)) -- Sets all the created vehicles' color to 255, 0, 0 (RGB) red. | |||
end | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{VehicleFunctions}} |
Latest revision as of 17:20, 16 January 2020
Description
Get all the vehicle identifiers in a table.
Syntax
GetAllVehicles()
Parameters
- This function has no parameters.
Return Value
- This function returns a table with valid vehicle identifiers.
Example
for k, v in pairs(GetAllVehicles()) do
SetVehicleColor(v, RGB(255, 0, 0)) -- Sets all the created vehicles' color to 255, 0, 0 (RGB) red.
end
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