GetVehicleDimension: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|Gets the dimension of this vehicle.}} {{FuncSyntax|GetVehicleDimension(vehicle)}} {{FuncParameters}} {{FuncParam|vehicle|The..." |
FlyingFork (talk | contribs) No edit summary |
||
Line 11: | Line 11: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua> | |||
function getVehiclesInDimension(dimension) | |||
dimension = tonumber(dimension) | |||
if not dimension or dimension < 0 or dimension > 4294967295 then | |||
return false | |||
end | |||
local vehicles = {} | |||
for index, vehicle in ipairs(GetAllVehicles()) do | |||
if GetVehicleDimension(vehicle) == dimension then | |||
table.insert(vehicles, vehicle) | |||
end | |||
end | |||
return vehicles | |||
end | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{VehicleFunctions}} |
Latest revision as of 16:22, 27 May 2021
Description
Gets the dimension of this vehicle.
Syntax
GetVehicleDimension(vehicle)
Parameters
- vehicle
The vehicle identifier.
Return Value
- Returns the dimension.
Example
function getVehiclesInDimension(dimension)
dimension = tonumber(dimension)
if not dimension or dimension < 0 or dimension > 4294967295 then
return false
end
local vehicles = {}
for index, vehicle in ipairs(GetAllVehicles()) do
if GetVehicleDimension(vehicle) == dimension then
table.insert(vehicles, vehicle)
end
end
return vehicles
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