Full View config.lua

Preview File Updated: v1.0.5 - 09.06.2023

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.
-- Client Trigger to open is TriggerEvent("hidden:hidden", ID_OF_VEHICLESHOP)

-- █▀ █▀▄ ▄▀▄ █▄ ▄█ ██▀ █   █ ▄▀▄ █▀▄ █▄▀
-- █▀ █▀▄ █▀█ █ ▀ █ █▄▄ ▀▄▀▄▀ ▀▄▀ █▀▄ █ █

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

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

-- @PlayerLoaded for ESX: "esx:playerLoaded"
-- @PlayerLoaded for QB-Core: "QBCore:Client:OnPlayerLoaded"
Config.PlayerLoaded = 'esx:playerLoaded' -- its a trigger to load players tattoos

-- @JobUpdated for ESX: "esx:setJob"
-- @JobUpdated for QB-Core: "QBCore:Client:OnJobUpdate"
Config.JobUpdated = 'esx:setJob' -- its a trigger to check players job

Config.UseVehicleColorsRGB = true

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

Config.Hud = {
	Enable = function()
		DisplayRadar(true)
		-- exports['vms_hud']:Display(true) -- here insert your export / trigger to enable hud after exit from showroom
	end,
	Disable = function()
		DisplayRadar(false)
		-- exports['vms_hud']:Display(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-car")
		-- TriggerEvent('esx:showNotification', message)
        -- TriggerEvent('QBCore:Notify', message, 'success', time)
    elseif type == "error" then
        exports["vms_notify"]:Notification("VEHICLE SHOP", message, time, "#FF0909", "fa-solid fa-car")
		-- TriggerEvent('esx:showNotification', message)
        -- TriggerEvent('QBCore:Notify', message, 'error', time)
    end
end

Config.PlateLetters  = 2
Config.PlateNumbers  = 5

Config.GiveKeysBuy = 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.GiveKeysTestDrive = 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",
		-- requiredJob = 'police',
		-- requiredJobGrade = {'boss'}, -- string: 'boss' or table: {'boss', 'manager'}
        coords = vector3(-33.37, -1103.75, 25.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, 12.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, 4.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",
}

Last updated