Vehicle

MSK.GetClosestVehicle

local vehicle, distance = MSK.GetClosestVehicle()

if DoesEntityExist(vehicle) and distance <= 2.5 then
    -- Do something with this vehicle
end


-- As an Export:
local player, distance = exports.msk_core:GetClosestVehicle()

MSK.GetClosestVehicles

Parameters maxDistance - float - Max distance to check for vehicles - Max Distance is 200.0

local vehicles = MSK.GetClosestVehicles(GetEntityCoords(PlayerPedId()), 25.0)

-- As an Export:
local player, distance = exports.msk_core:GetClosestVehicles(coords, maxDistance)

MSK.GetVehicleInDirection

Get the Vehicle in front of the player

Returns vehicle - int - A vehicle handle coords - vector3 - The vehicle coords distance - float - The distance between the vehicle and the player

local vehicle, coords, distance = MSK.GetVehicleInDirection()

-- As an Export:
local vehicle, coords, distance = exports.msk_core:GetVehicleInDirection()

MSK.IsVehicleEmpty

Get whether the vehicle is empty or not

Parameters vehicle - int - A vehicle handle

Returns isVehicleEmpty - boolean - whether the vehicle is empty or not

local vehicle, coords, distance = MSK.GetVehicleInDirection()
local isVehicleEmpty = MSK.IsVehicleEmpty(vehicle)
print(isVehicleEmpty)

-- As an Export:
local isVehicleEmpty = exports.msk_core:IsVehicleEmpty(vehicle)

MSK.GetVehicleLabel

Parameters vehicle - int - A vehicle handle

Returns label - string - Label of the vehicle

local label = MSK.GetVehicleLabel(vehicle)

-- As an Export:
local label = exports.msk_core:GetVehicleLabel(vehicle)

Last updated