Version: 1.2.4
Installation
Requirements
ox_liboxmysql- One supported framework:
- ESX
- QB-Core
- QBox
Install Resource
Place the resource in your server resources directory:
resources/[lg]/LG-ThunderGarageDo not rename the resource folder.
Database
Automatic database setup is enabled by default:
-- config/advanced.lua
Config.AutoRunSQL = trueTo install SQL manually, disable automatic setup:
Config.AutoRunSQL = falseThen import the correct file:
ESX
sql/run-esx.sqlQB-Core / QBox
sql/run-qb.sqlDatabase repair file:
sql/sql_fix_columns.sqlAlways back up your database before importing SQL.
Server Start Order
ESX
ensure oxmysql
ensure ox_lib
ensure es_extended
ensure LG-ThunderGarageQB-Core
ensure oxmysql
ensure ox_lib
ensure qb-core
ensure LG-ThunderGarageQBox
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure LG-ThunderGarageFuel, vehicle keys, banking and other integrations must start before LG Thunder Garage.
Config
Configuration Files
config/core.lua
config/public_garages.lua
config/private_garages.lua
config/job_garages.lua
config/gang_garages.lua
config/impounds.lua
config/interiors.lua
config/advanced.lua
config/client.lua
config/server.luaFramework
Open:
config/core.luaConfig.Framework = "ESX"Supported values:
Config.Framework = "auto"
Config.Framework = "ESX"
Config.Framework = "QBCore"
Config.Framework = "Qbox"Using an explicit framework value is recommended.
Language and Currency
Config.Locale = "cn"
Config.NumberAndDateFormat = "zh-CN"
Config.Currency = "CNY"English example:
Config.Locale = "en"
Config.NumberAndDateFormat = "en-US"
Config.Currency = "USD"E-Key Interaction Without NPC
Config.UseTarget = false
Config.TargetPed = false
Config.UseRadialMenu = false
Config.DrawText = "ox_lib"
Config.OpenGarageKeyBind = 38
Config.InsertVehicleKeyBind = 38
Config.OpenImpoundKeyBind = 38
Config.ExitInteriorKeyBind = 38Control 38 is the default FiveM E key.
Integrations
LGGarageConfig.Integrations = {
Fuel = "ox_fuel",
VehicleKeys = "auto",
Notifications = "ox_lib",
Banking = "okokBanking",
TextUI = "ox_lib",
Target = "ox_target",
RadialMenu = "ox_lib",
Mechanic = "lg-mechanic",
Mileage = "lg-vehiclemileage",
Dealerships = "lg-dealerships"
}Change integrations to match the resources installed on your server.
Vehicle Images
Config.Interface.EnableVehicleImages = true
Config.Interface.VehicleImageSource = "cfx-first"
Config.Interface.VehicleImageFormat = "png"Available image source modes:
cfx-first
hybrid
local
cfxCustom vehicle images must use the lowercase vehicle spawn name:
vehicle_images/sultanrs.png
vehicle_images/police3.png
vehicle_images/customvehicle.pngVehicle Storage
Config.SaveVehicleDamage = true
Config.AdvancedVehicleDamage = true
Config.SaveVehiclePropsOnInsert = true
Config.CheckVehicleModel = true
Config.SpawnVehiclesWithServerSetter = false
Config.DoNotSpawnInsideVehicle = falseRecommended:
Config.SpawnVehiclesWithServerSetter = falseVehicle Transfers
Config.EnableTransfers = {
betweenGarages = true,
betweenPlayers = true
}
Config.GarageVehicleTransferCost = 1500
Config.DisableTransfersToUnregisteredGarages = falseBlocked player-transfer vehicles can be configured in:
config/advanced.luaConfig.PlayerTransferBlacklist = {
"police",
"ambulance"
}Public Garage
Public garages are configured in:
config/public_garages.luaExample:
Config.GarageLocations["Legion Square"] = {
coords = vector3(215.09, -805.17, 30.81),
spawn = {
vector4(216.84, -802.02, 30.78, 69.82),
vector4(218.09, -799.42, 30.76, 66.17)
},
distance = 18,
type = "car",
interior = {
enabled = true,
template = "standard"
},
hideBlip = false,
blip = {
id = 357,
color = 0,
scale = 0.7
},
hideMarkers = false,
markers = {
id = 21,
size = {
x = 0.42,
y = 0.42,
z = 0.42
},
color = {
r = 216,
g = 166,
b = 42,
a = 170
},
bobUpAndDown = 0,
faceCamera = 0,
rotate = 1,
drawOnEnts = 0
}
}Supported garage types:
type = "car"
type = "sea"
type = "air"Every garage name must be unique.
Garage Interiors
Global setting:
Config.GarageEnableInteriors = true
Config.GarageDefaultInteriorEnabled = trueEnable an interior for one garage:
interior = {
enabled = true,
template = "standard"
}Disable it:
interior = {
enabled = false,
template = "standard"
}Interior coordinates are configured in:
config/interiors.luaConfig.GarageInteriorEntrance = vector4(
227.96,
-1003.06,
-99.0,
0.0
)Impound
Impound settings are located in:
config/impounds.luaConfig.ImpoundCommand = "iv"
Config.ImpoundFeesSocietyFund = false
Config.ImpoundShowBlips = true
Config.ImpoundTimeOptions = {
0,
1,
4,
12,
24,
72,
168
}Vehicle visibility and retrieval:
Config.ImpoundShowRestrictedToOwner = true
Config.ImpoundDefaultRetrievable = true
Config.ImpoundJobViewAllLocations = true
Config.ImpoundOwnerViewAllLocations = trueImpound location example:
Config.ImpoundLocations["Impound A"] = {
coords = vector3(404.99, -1626.91, 29.29),
spawn = {
vector4(409.87, -1647.58, 28.88, 228.80)
},
distance = 5,
type = "car",
job = {
"police"
},
hideBlip = false,
blip = {
id = 68,
color = 0,
scale = 0.7
},
hideMarkers = false
}Debug
-- config/advanced.lua
Config.Debug = falseEnable temporarily when diagnosing a problem:
Config.Debug = trueKeep debug mode disabled on production servers.
Exports
Get Current Vehicle Stats
Client export:
local stats = exports["LG-ThunderGarage"]:GetCurrentVehicleStats()Returns nil when the player is not inside a vehicle.
Example result:
{
engine = 1000.0,
body = 1000.0,
fuel = 75.0,
enginePercent = 100.0,
bodyPercent = 100.0,
fuelPercent = 75.0,
engineDisplay = "100.0%",
bodyDisplay = "100.0%",
fuelDisplay = "75.0%"
}Example:
local stats = exports["LG-ThunderGarage"]:GetCurrentVehicleStats()
if stats then
print(("Fuel: %s"):format(stats.fuelDisplay))
endGet All Garages
Server export:
local garages = exports["LG-ThunderGarage"]:getAllGarages()Example:
for _, garage in ipairs(garages) do
print(garage.name, garage.type)
endEach garage can include:
{
name = "Legion Square",
label = "Legion Square",
type = "car",
takeVehicle = vector3(...),
putVehicle = vector3(...),
spawnPoint = {
vector4(...)
},
showBlip = true,
blipName = "Legion Square",
blipNumber = 357,
blipColor = 0,
vehicle = "car"
}Impound Vehicle
Server export:
local success = exports["LG-ThunderGarage"]:impoundVehicle(
source,
plate,
impoundId,
reason,
retrievable,
retrievalDate,
retrievalCost,
vehicleProps,
fuel,
engine,
body,
damage,
retrievalTimestamp
)Parameters:
source Player server ID
plate Vehicle plate
impoundId Configured impound location name
reason Impound reason
retrievable Whether the owner can retrieve the vehicle
retrievalDate Display retrieval date/time
retrievalCost Retrieval price
vehicleProps Vehicle property table
fuel Fuel level from 0 to 100
engine Engine health
body Body health
damage Vehicle damage table
retrievalTimestamp Unix timestamp when retrieval becomes availableExample:
local vehicle = GetVehiclePedIsIn(GetPlayerPed(source), false)
if vehicle == 0 then
return
end
local plate = GetVehicleNumberPlateText(vehicle)
local props = {}
local damage = {}
local success = exports["LG-ThunderGarage"]:impoundVehicle(
source,
plate,
"Impound A",
"Illegal parking",
true,
os.date("%Y-%m-%d %H:%M:%S", os.time() + 3600),
1500,
props,
75.0,
900.0,
850.0,
damage,
os.time() + 3600
)
if not success then
print("Failed to impound vehicle")
endValidate all export parameters server-side before calling the impound export.