[ESX] MSK Garage and Impound

Tebex [19.99€ incl. VAT] - Encrypted
Tebex [29.99€ incl. VAT] - Source Code

Images: MSK Garage UI - Album on Imgur

Description

You can add your own Vehicle Key Script in server_vehiclekeys.lua, but I can only give support for the Scripts that I’ve mentioned below at Optional Requirements!

  • Set as many Garages and Impounds as you want
  • You can use Custom License plates like “CUSTOM”
  • You can park in and park out a vehicle if you have a Key - [Supported KeyScript required] [You can set it to false in config]
  • At the Impound you can set a Waypoint to your vehicle if it is parked out
  • Set your own Notifications
  • Set NPCs or Markers with 3D Text
  • Support for okokTextUI and esx_textUI
  • Set if you want park out vehicles where you parked it in or if you want to park out vehicles everywhere
  • Set your own Fuel System [default: ox_fuel]
  • Set Jobs and Grades who can access the Garage or Impound
  • Set if its a car, boat or air Garage [default: all Categories]
  • You can set as many parkout Spots as you want
  • Set the Blip you want or deactivate the Blip
  • You can set a vehicle as Favourite
  • You can rename the vehicle name

Config

Open Config
Config = {}
----------------------------------------------------------------
Config.Locale = 'de' -- 'de', 'en'
Config.Debug = true
Config.VersionChecker = true
----------------------------------------------------------------
-- !!! This function is clientside AND serverside !!!
Config.Notification = function(source, message, typ)
    if IsDuplicityVersion() then -- serverside
        MSK.Notification(source, 'MSK Garage', message, typ) -- replace this with your Notify
    else -- clientside
        MSK.Notification('MSK Garage', message, typ) -- replace this with your Notify
    end
end
----------------------------------------------------------------
Config.Hotkey = 38 -- default: 38 = E // Change the Key in translation.lua too

Config.npcVoice = {
    enable = true, -- The NPC will say something to you
    inRange = 5.0,
    outRange = 5.0
}

Config.defaultTextUI = true -- Set false if you want to use a custom textui

Config.openTextUI = function(coloredText, uncoloredText)
    exports['okokTextUI']:Open(uncoloredText, 'darkblue', 'left')
    -- exports["esx_textui"]:TextUI(uncoloredText, 'info')
end

Config.closeTextUI = function()
    exports['okokTextUI']:Close()
    -- exports["esx_textui"]:HideUI()
end

Config.MySQL = { -- Look at your owned_vehicles table and correct this
    type = "type", -- vehicle type (car, boat, air)
    job = "job", 
    stored = "stored",
    civ = "civ", -- Job for Civilist (DON'T TOUCH if job is NULL in owned_vehicles)
}

Config.Parking = 'specific' -- 'all' = Park out every vehicle everywhere // 'specific' = Park out your vehicle where you parked it in.
----------------------------------------------------------------
-- With this Feature you can park in and park out Vehicles if you are not the owner but have a second key
-- You can add your own Key Script in server_vehiclekeys.lua

-- msk_vehiclekeys: https://forum.cfx.re/t/esx-qbcore-msk-vehiclekeys-unique-items/5264475
-- vehicle_keys: https://forum.cfx.re/t/esx-qbcore-vehicles-keys-vehicles-lock-remote-control-ui-and-much-more/4857274
-- VehicleKeyChain: https://forum.cfx.re/t/release-vehicle-key-chain-v4-1-4-esx-qb/3319563

Config.VehicleKeys = {
    enable = true,
    script = 'msk_vehiclekeys'
}

Config.AdvancedParking = true -- Set to false if you dont want to use this // https://forum.cfx.re/t/advancedparking-v3-7-0-major-update-esx-qb-standalone/2099582

-- Searching for "society_jobname" in database
Config.useSocietyName = false
----------------------------------------------------------------
-- !!! This function is clientside ONLY !!!
Config.SetFuel = function(vehicle, fuel)
    -- exports['LegacyFuel']:SetFuel(vehicle, fuel) -- LegacyFuel
    -- exports['myFuel']:SetFuel(vehicle, fuel) -- myFuel
    -- SetVehicleFuelLevel(vehicle, fuel + 0.0) -- FiveM Native
    -- exports['qs-fuelstations']:SetFuel(vehicle, fuel) -- Quasar Fuelstations
    Entity(vehicle).state.fuel = fuel -- ox_fuel
end

Config.GetFuel = function(vehicle)
    -- return exports["LegacyFuel"]:GetFuel(vehicle) -- LegacyFuel
    -- return exports['myFuel']:GetFuel(vehicle) -- myFuel
    -- return GetVehicleFuelLevel(vehicle) -- FiveM Native
    -- return exports['qs-fuelstations']:GetFuel(vehicle) -- Quasar Fuelstations
    return Entity(vehicle).state.fuel -- ox_fuel
end
----------------------------------------------------------------
Config.enableImpound = true -- Set false to disable all Impounds
Config.parkoutWithKey = true -- Set true if you want to parkout a vehicle with a key at the Impound
Config.needEnoughMoney = true -- Set false if player should be able to parkout a vehicle from impound if not enough money

Config.Impounds = {
    ["impound_car"] = {
        label = 'Impound | Car',
        type = {"car", "truck"}, -- "car", "truck", "boat", "aircraft", "helicopter" // Look into you database for that
        pedmodel = {enable = true, model = 'csb_trafficwarden', distance = 20.0},
        text3d = {enable = true, label = '~g~Open Impound', size = 0.8},
        marker = {enable = true, distance = 5.0, type = 27, size = {a = 1.0, b = 1.0, c = 1.0}, color = {a = 255, b = 255, c = 255}},
        blip = {enable = true, id = 524, color = 17, scale = 0.8},
        locations = { -- Only for NPC and Marker
            vector4(409.0, -1622.75, 29.29, 231.88),
        },
        park_dist = 5.0, -- Distance between Parkout Spots // Don't change this if you don't know what this is
        park_out = { -- You can set multiple locations
            vector4(401.36, -1647.98, 29.29, 318.54),
            vector4(406.09, -1652.36, 29.29, 320.51),
        },
        warp = false, -- Set false if you don't want to warp into the vehicle
        fee = {enable = true, price = 150, account = 'money' --[['money', 'bank']]} -- Fee to Park out a vehicle
    },
    ["impound_boat"] = {
        label = 'Impound | Boat',
        type = {"boat"}, -- "car", "truck", "boat", "aircraft", "helicopter" // Look into you database for that
        pedmodel = {enable = true, model = 'csb_trafficwarden', distance = 20.0},
        text3d = {enable = true, label = '~g~Open Impound', size = 0.8},
        marker = {enable = true, distance = 5.0, type = 27, size = {a = 1.0, b = 1.0, c = 1.0}, color = {a = 255, b = 255, c = 255}},
        blip = {enable = true, id = 410, color = 17, scale = 0.8},
        locations = { -- Only for NPC and Marker
            vector4(-788.38, -1490.3, 1.6, 289.21),
        },
        park_dist = 5.0, -- Distance between Parkout Spots // Don't change this if you don't know what this is
        park_out = { -- You can set multiple locations
            vector4(-797.84, -1490.21, -0.47, 301.0),
        },
        warp = true, -- Set false if you don't want to warp into the vehicle
        fee = {enable = true, price = 200, account = 'money' --[['money', 'bank']]} -- Fee to Park out a vehicle
    },
    ["impound_heli"] = {
        label = 'Impound | Aircrafts',
        type = {"aircraft", "helicopter"}, -- "car", "truck", "boat", "aircraft", "helicopter" // Look into you database for that
        pedmodel = {enable = true, model = 'csb_trafficwarden', distance = 20.0},
        text3d = {enable = true, label = '~g~Open Impound', size = 0.8},
        marker = {enable = true, distance = 5.0, type = 27, size = {a = 1.0, b = 1.0, c = 1.0}, color = {a = 255, b = 255, c = 255}},
        blip = {enable = true, id = 569, color = 17, scale = 0.8},
        locations = { -- Only for NPC and Marker
            vector4(-1070.57, -2867.78, 13.95, 152.85),
        },
        park_dist = 5.0, -- Distance between Parkout Spots // Don't change this if you don't know what this is
        park_out = { -- You can set multiple locations
            vector4(-1112.54, -2883.81, 13.95, 147.98),
        },
        warp = false, -- Set false if you don't want to warp into the vehicle
        fee = {enable = true, price = 500, account = 'money' --[['money', 'bank']]} -- Fee to Park out a vehicle
    },
}
----------------------------------------------------------------
Config.DefaultGarage = 'A' -- Set this to your default Garage ID

Config.Garages = {
    ----------------------------------------------------------------
    -------------------- Garage Car & Motorcycles ------------------
    ----------------------------------------------------------------

    ["A"] = { -- This is the Garage ID that will be inserted into database
        id = 'A', -- This is the Garage ID that will be inserted into database
        label = 'Garage | Meetingpoint', -- Würfelpark
        type = {"car", "truck"}, -- "car", "truck", "boat", "aircraft", "helicopter" // Look into you database for that
        distance = 40.0, -- The max distance to park-in vehicles
        jobs = {enable = false, identifier = 'player' --[[identifier from 'player' or 'society']], ownJob = true --[[true: will only show vehicles that are from the same job you are employed at]], jobs = { 
            -- If you set identifier = 'society' then you have to set the identifier in database to the jobname. Example: https://prnt.sc/5YQnA743Yftj
            {job = 'police', grade = 0}, -- owned_vehicles -> job has to be set to 'police'
            {job = 'ambulance', grade = 0}, -- owned_vehicles -> job has to be set to 'ambulance'
        }},
        pedmodel = {enable = true, model = 'csb_trafficwarden', distance = 20.0},
        text3d = {enable = true, label = '~g~Open Garage', size = 0.8},
        marker = {enable = true, distance = 5.0, type = 27, size = {a = 1.0, b = 1.0, c = 1.0}, color = {a = 255, b = 255, c = 255}},
        blip = {enable = true, id = 524, color = 26, scale = 0.8},
        locations = { -- Only for NPC and Marker
            {x = 213.98, y = -808.45, z = 31.01, h = 156.59},
        },
        park_dist = 5.0, -- Distance between Parkout Spots // Don't change this if you don't know what this is
        park_out = { -- You can set multiple locations
            {x = 232.98, y = -790.3, z = 30.6, h = 161.46},
        },
        warp = false, -- Set false if you don't want to warp into the vehicle
    },
    ["B"] = { -- This is the Garage ID that will be inserted into database
        id = 'B', -- This is the Garage ID that will be inserted into database
        label = 'Garage | Car', -- Rockford Hills
        type = {"car", "truck"}, -- "car", "truck", "boat", "aircraft", "helicopter" // Look into you database for that
        distance = 20.0, -- The max distance to park-in vehicles
        jobs = {enable = false, identifier = 'society' --[[identifier from 'player' or 'society']], ownJob = true --[[true: will only show vehicles that are from the same job you are employed at]], jobs = { 
            -- If you set identifier = 'society' then you have to set the identifier in database to the jobname. Example: https://prnt.sc/5YQnA743Yftj
            {job = 'police', grade = 0}, -- owned_vehicles -> job has to be set to 'police'
            {job = 'ambulance', grade = 0}, -- owned_vehicles -> job has to be set to 'ambulance'
        }},
        pedmodel = {enable = true, model = 'csb_trafficwarden', distance = 20.0},
        text3d = {enable = true, label = '~g~Open Garage', size = 0.8},
        marker = {enable = true, distance = 5.0, type = 27, size = {a = 1.0, b = 1.0, c = 1.0}, color = {a = 255, b = 255, c = 255}},
        blip = {enable = true, id = 524, color = 26, scale = 0.8},
        locations = { -- Only for NPC and Marker
            {x = -899.275, y = -153.0, z = 41.88, h = 115.59},
        },
        park_dist = 5.0, -- Distance between Parkout Spots // Don't change this if you don't know what this is
        park_out = { -- You can set multiple locations
            {x = -901.989, y = -159.28, z = 41.46, h = 204.0},
        },
        warp = false, -- Set false if you don't want to warp into the vehicle
    },

    ----------------------------------------------------------------
    ------------------------ Garage for Jobs -----------------------
    ----------------------------------------------------------------

    ["police_mrpd_a"] = { -- This is the Garage ID that will be inserted into database
        id = 'police_mrpd_a', -- This is the Garage ID that will be inserted into database
        label = 'Garage | Police', -- Cayo Perico Airport
        type = {"car", "truck"}, -- "car", "truck", "boat", "aircraft", "helicopter" // Look into you database for that
        distance = 20.0, -- The max distance to park-in vehicles
        jobs = {enable = true, identifier = 'society' --[[identifier from 'player' or 'society']], ownJob = true --[[true: will only show vehicles that are from the same job you are employed at]], jobs = { 
            -- If you set identifier = 'society' then you have to set the identifier in database to the jobname. Example: https://prnt.sc/5YQnA743Yftj
            {job = 'police', grade = 0}, -- owned_vehicles -> job has to be set to 'police'
        }},
        pedmodel = {enable = true, model = 's_m_y_cop_01', distance = 20.0},
        text3d = {enable = true, label = '~g~Open Garage', size = 0.8},
        marker = {enable = true, distance = 5.0, type = 27, size = {a = 1.0, b = 1.0, c = 1.0}, color = {a = 255, b = 255, c = 255}},
        blip = {enable = false, id = 524, color = 29, scale = 0.8},
        locations = { -- Only for NPC and Marker
            {x = 460.1, y = -986.74, z = 25.7, h = 92.28},
        },
        park_dist = 5.0, -- Distance between Parkout Spots // Don't change this if you don't know what this is
        park_out = { -- You can set multiple locations
            {x = 455.61, y = -980.5, z = 25.7, h = 90.34},
        },
        warp = false, -- Set false if you don't want to warp into the vehicle
    },
}

Optional Requirements

Code is accessible No
Subscription-based No
Lines (approximately) ~ 1200
Requirements ESX Legacy, oxmysql, msk_core
Support Yes

My other Scripts

Paid

Free

9 Likes

Love it :heart_eyes:

3 Likes

Update v2.2

  • Some little Bugfixes
  • Fixed Bug with Fuel and added more fuel scripts to config.lua
  • Added compatibility for Jaksam Vehicle Keys
  • You can add your own Vehicle Key Script to server_vehiclekeys.lua
1 Like

A super garage, ideal for roleplay servers who want to have simplicity but also quality! :slight_smile:
the support is also very good.

2 Likes

Update v3.0

Changed files: all files including config.lua

  • New UI Design with new Features!
  • Added Favorite Vehicles
  • Added Rename Vehicle Name
  • Added Config.needEnoughMoney for Impound
  • Added new Translations
  • Updated Callbacks for msk_core

In config.lua just add the following and the edits in this file are done. If you updating from a lower version than v2.2 you have to replace the config completely.

Config.needEnoughMoney = true -- Set false if player should be able to parkout a vehicle from impound if not enough money


1 Like

Update v3.0.1

  • Added missing images
  • Added Support for visn_are (isPlayerDead)
  • Fixed lagging ui and server thread hitch warning
  • Fixed Jaksam vehicle_keys

To date a good garage system, bugs are fixed quickly, wishes are taken into account.
top

1 Like

Update v3.2.2

  • Some Bugfixes
  • Changed folder structure
  • Added compatibility for MSK VehicleKeys