MSK Scripts
TebexGithubDiscordMusiker15
  • MSK Scripts
    • Welcome
  • Common Issues
    • Keymaster
  • Miscellaneous
    • Change Notifications
  • Scripts
    • MSK Core
      • Installation
      • Functions
        • Client
          • Ace Permission
          • Commands
          • Coords
          • Player
          • Points
          • Request
          • Scaleform
          • UI
            • Input
            • Numpad
            • Progressbar
            • TextUI
          • Vehicle
        • Shared
          • String
          • Math
          • Table
          • Timeout
          • Vector
        • Server
          • Ace Permission
          • Ban System
          • Commands
          • Player
          • Scaleform
          • UI
            • Input
            • Numpad
            • Progressbar
            • TextUI
    • MSK Banking
      • Installation
        • Paycheck Transaction
      • Config
      • Exports
        • Client
        • Server
      • Events
        • Client
        • Server
      • Server Callbacks
    • MSK EngineToggle
      • Guides
      • Exports
        • Client
      • Event Handler
        • Client
        • Server
    • MSK Fuel
      • Config
      • Exports
        • Client
    • MSK Garage
      • Config
      • Exports
        • Client
    • MSK Handcuffs
      • Guides
        • General Edits for Jobs
        • Jaksam Job Creator
        • Multichar
        • ox_inventory
      • Config
      • Admin Commands
      • Exports
        • Client
        • Server
      • Events
        • Client
        • Server
      • Event Handlers
    • MSK Radio
      • Config
      • Exports
        • Client
        • Server
      • Events
        • Server
    • MSK Simcard
      • Installation
        • Config.Database
      • Config
    • MSK VehicleKeys
      • Guides
        • Installation
        • Integrations
      • Config
      • Admin Commands
      • Exports
        • Client
        • Server
    • MSK Whitelist
      • Config
      • Exports
        • Client
        • Server
    • MSK Weaponammo
Powered by GitBook
On this page
  • MSK.GetClosestVehicle
  • MSK.GetClosestVehicles
  • MSK.GetVehicleInDirection
  • MSK.IsVehicleEmpty
  • MSK.GetVehicleLabel
  1. Scripts
  2. MSK Core
  3. Functions
  4. Client

Vehicle

MSK.GetClosestVehicle

Parameters coords - vector3 - Coords - Optional, default: playerCoords

Returns vehicle - number - A vehicle handle distance - float - The Distance to this vehicle

local vehicle, distance = MSK.GetClosestVehicle(coords)

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

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

MSK.GetClosestVehicles

Parameters coords - vector3 - Player Coords 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 6 months ago