GetVehicleDimension

From Onset Developer Wiki
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