GetVehicleDimension

From Onset Developer Wiki
Revision as of 16:22, 27 May 2021 by FlyingFork (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
GetVehicleDimension

Type: Function
Context: Server
Introduced: v1.0

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