[ESX][QB] vms_vehicleshop | Cars, Boats, Planes



[TEBEX] $ BUY IT HERE

[SHOWCASE] vms_vehicleshop

Resmon while not using
image


:star: Features:

Compatible with ESX & QB-Core
Possibility to plug to the npctalk
Possibility to make several shops with vehicles, e.g. cars, planes, boats
Color selection before buying a vehicle
Possible test drive before purchase and the ability to set the price for a test drive for each showroom individually
Full support.

:gear: CONFIG

Config = {}

Config.DistanceViewMarker = 20.0
Config.DistanceView3DText = 5.0
Config.DistanceAccess = 2.0 -- The distance in which it will be possible to take a seat by pressing the E key
Config.KeyOpen = 38 -- 38 = E

Config.AccessOnMarker = true -- if you want to use this with marker acces, set true, if you want to use this script with for e.g vms_npctalk set false.

-- β–ˆβ–€ β–ˆβ–€β–„ β–„β–€β–„ β–ˆβ–„ β–„β–ˆ β–ˆβ–ˆβ–€ β–ˆ   β–ˆ β–„β–€β–„ β–ˆβ–€β–„ β–ˆβ–„β–€
-- β–ˆβ–€ β–ˆβ–€β–„ β–ˆβ–€β–ˆ β–ˆ β–€ β–ˆ β–ˆβ–„β–„ β–€β–„β–€β–„β–€ β–€β–„β–€ β–ˆβ–€β–„ β–ˆ β–ˆ

Config.Core = "ESX" -- "ESX" or "QB-Core"
Config.CoreDefine = ""
	-- ESX: "esx:getSharedObject" 
	-- QBCore: ""
	-- Or your custom trigger event also you can set nil to core define by exports["es_extended"]:getSharedObject, if Config.Core = "ESX" or exports['qb-core']:GetCoreObject() if Config.Core = "QBCore"

Config.CoreExport = function()
	return exports['es_extended']:getSharedObject()
	-- return exports['qb-core']:GetCoreObject()
end

Config.SoundsEffects = true -- if you want to sound effects by clicks set true

Config.Hud = {
	Enable = function()
		DisplayRadar(true)
		-- exports['hud']:DisplayHud(true) -- here insert your export / trigger to enable hud after exit from showroom
	end,
	Disable = function()
		DisplayRadar(false)
		-- exports['hud']:DisplayHud(false) -- here insert your export / trigger to disable hud after enter to showroom
	end
}

Config.Notification = function(message, time, type)
    if type == "success" then
        exports["vms_notify"]:Notification("VEHICLE SHOP", message, time, "#27FF09", "fa-solid fa-pen-nib")
		-- ESX.ShowNotification(message)
		-- QBCore.Functions.Notify(message, "success", 5000)
    elseif type == "error" then
        exports["vms_notify"]:Notification("VEHICLE SHOP", message, time, "#FF0909", "fa-solid fa-pen-nib")
		-- ESX.ShowNotification(message)
		-- QBCore.Functions.Notify(message, "error", 5000)
    end
end

Config.PlateLetters  = 2
Config.PlateNumbers  = 5

Config.GiveKeys = function(veh, plate, model)
	-- TriggerEvent('vehiclekeys:client:SetOwner', plate)
	-- exports['LegacyFuel']:SetFuel(veh, 100)
	-- Here insert your export / trigger to give keys to player and set fuel
end

Config.TestDrive = {
	displayTimer = true, -- this option runs DrawText3D over the vehicle with a countdown timer to the end of the test drive.
	time = 35, -- in seconds
	coords = vector4(-1267.47, -3374.01, 12.94, 327.4), -- coords of spawn the vehicle
	maxDistance = 500, -- maximum distance from coords
}

Config.VehicleShops = {
    [1] = {
		blip = {sprite = 225, scale = 0.75, color = 28, display = 4},
		categories = {'motorcycle', 'quad', 'compact', 'classic', 'muscle', 'coupe', 'sedan', 'sport', 'supercar', 'offroad', 'suv', 'pickup', 'van'}, -- if you adding new categories, you need add also .svg file at the same name for @vms_vehicleshop/html/icons/
		testDrive = true,
		testDrivePrice = 0,
		type = 'car',
		icon = 'fa-solid fa-car',
		name = "CAR DEALER",
        coords = vector3(-33.37, -1103.75, 26.35),
		carCoords = vector4(-69.79, -824.51, 221.0, 61.72),
		camCoord = vector3(-74.72, -824.49, 223.15),
		buyCoords = vector4(-31.04, -1090.45, 25.42, 334.67),
		drawable = {
			['marker'] = true,
			['3dtext'] = true
		},
		vehicles = Vehicles[1] -- Vehicles in the config.vehicles.lua
	},
	[2] = {
		blip = {sprite = 90, scale = 0.75, color = 66, display = 4},
		categories = {'helicopter', 'airplane'}, -- if you adding new categories, you need add also .svg file at the same name for @vms_vehicleshop/html/icons/
		testDrive = false,
		testDrivePrice = 0,
		type = 'fly',
		icon = 'fa-solid fa-plane',
		name = "PLANE DEALER",
		coords = vector3(-941.37, -2954.7, 13.8),
		carCoords = vector4(-974.58, -3000.76, 12.95, 58.63),
		camCoord = vector3(-988.33, -3001.73, 14.95),
		buyCoords = vector4(-974.89, -3082.39, 12.94, 58.0),
		drawable = {
			['marker'] = true,
			['3dtext'] = true
		},
		vehicles = Vehicles[2]
	},
	[3] = {
		blip = {sprite = 90, scale = 0.75, color = 66, display = 4},
		categories = {}, -- if you adding new categories, you need add also .svg file at the same name for @vms_vehicleshop/html/icons/
		testDrive = false,
		testDrivePrice = 0,
		type = 'boat',
		icon = 'fa-solid fa-ship',
		name = "BOATS DEALER",
		coords = vector3(-704.18, -1398.44, 5.4),
		carCoords = vector4(-797.95, -1502.53, -0.45, 112.22),
		camCoord = vector3(-802.24, -1512.52, 2.69),
		buyCoords = vector4(-783.76, -1436.2, -0.06, 136.22),
		drawable = {
			['marker'] = true,
			['3dtext'] = true
		},
		vehicles = Vehicles[3]
	},
}

Config.Translate = {
	['notify.you_bought'] = "You bought %s %s for %s$.",
	['notify.enought_money'] = "You dont have money for %s %s.",
	['notify.you_bought_test'] = "You bought test drive for %s$.",
	['notify.enought_money_for_test'] = "You dont have money for test drive.",
	['3dtext.time_remaining'] = "%s seconds remaining",
	['3dtext.open'] = "Press [E] to open",
}

:anger: You can check my others scripts :anger:
vms_gangmissions
vms_clothestore
vms_charcreator
vms_multichars + vms_identity
vms_tattooshop
vms_barber
vms_pausemenu
vms_skydiving
vms_races
vms_drivingschool
vms_boatschool
vms_flyingschool
vms_bank
vms_notify
vms_shops
vms_redeem
vms_garage
vms_jobcenter
interact

Code is accessible Yes / No
Subscription-based No
Lines (approximately) +500 Lua
Requirements ESX / QBCore
Support Yes
5 Likes

nice work as always bro

1 Like

Thank you men :blush:

Looks good.

1 Like

Thanks :smiley:

Looks good. Maybe option to work with ox_target?

Thanks, I think you can do that because trigger to open the vehicleshop menu is in the config and you just need to create a target

:computer: UPDATE 1.0.1

[+] Added Config.UseVehicleColorsRGB, if you use vehicle colors by index, set it false, if you use custom colors by rgb, set it true

:computer: UPDATE 1.0.2

[/] Changed from Config.GiveKeys to Config.GiveKeysBuy
[+] Added Config.GiveKeysTestDrive - to be able to give the keys for a test drive


:computer: UPDATE 1.0.3

[+] Added Config.PlayerLoaded
[+] Added Config.JobUpdated
[+] Added requiredJob & requiredJobGrade to Config.VehicleShops - this means that you can make vehicleshop available only when the player has a certain job and you can make that it requires a certain rank to be able to use the services of a car dealer

:computer: UPDATE 1.0.4

[/] Fixed a bug with setting up a car dealer only for a job

:computer: UPDATE 1.0.5

[+] Fixed Config.UseVehicleColorsRGB for QB-Core

I have an isssue, i buy a heli but when i put in the garage is not here later. I use qs-garages

The problem was solved with ticket :white_check_mark:

:computer: UPDATE 1.0.6

[+] Added support for target system (Config.Target) and option targetSystemRotation to all shops in Config.VehicleShops
[+] Added Config.UseRoutingBucketsInShowRoom & Config.UseRoutingBucketsOnTestDrive
[+] Added ability to set a custom prefix for vehicle license plates purchased from the vehicle shop (Config.PlateCustomPrefix)
[+] Added function DrawText3D to config.client.lua which you can modify to your own preference
[+] Added Config.VehicleInShowRoom to config.client.lua, with this function you can modify vehicle in showroom like set custom license plate β€œSHOWROOM”

:computer: UPDATE 1.0.7

[/] Fixed the problem with buying vehicle with when using option Config.UseRoutingBucketsInShowRoom
[+] Added Config.UseFadeWithSpawn: smoother transition when buying a vehicle

anyway to add license check before buying vehicle?

Hi, you can add license checking in config.server.lua inside money checker callback.
In the next update I will add by default it.

1 Like

Does it include selling and renting cars