Installation
Resource installation guide and dependencies
Framework
Dependencies
1 - Start
2 - SQL
3 - Jobs (ESX Framework)
4 - Items
ESX
QB Core
13KB
OX Inventory
5KB
5 - Configuration
6 - Ensure Dependencies
7 - Ready
Last updated
--- Create Job at Runtime
--- @param name string
--- @param label string
--- @param grades table
function ESX.CreateJob(name, label, grades)
if not name then
return print('[^3WARNING^7] missing argument `name(string)` while creating a job')
end
if not label then
return print('[^3WARNING^7] missing argument `label(string)` while creating a job')
end
if not grades or not next(grades) then
return print('[^3WARNING^7] missing argument `grades(table)` while creating a job!')
end
local parameters = {}
local job = { name = name, label = label, grades = {} }
for _, v in pairs(grades) do
job.grades[tostring(v.grade)] = { job_name = name, grade = v.grade, name = v.name, label = v.label, salary = v.salary, skin_male = v.skin_male or '{}', skin_female = v.skin_female or '{}' }
parameters[#parameters + 1] = { name, v.grade, v.name, v.label, v.salary, v.skin_male or '{}', v.skin_female or '{}'}
end
MySQL.insert('INSERT IGNORE INTO jobs (name, label) VALUES (?, ?)', { name, label })
MySQL.prepare('INSERT INTO job_grades (job_name, grade, name, label, salary, skin_male, skin_female) VALUES (?, ?, ?, ?, ?, ?, ?)', parameters)
ESX.Jobs[name] = job
endfunction ESX.DeleteJob(name)
--- @param name string
if not name then
return print('[^3WARNING^7] missing argument `name(string)` while deleting a job')
end
MySQL.update('DELETE FROM jobs WHERE name = ?', {name})
MySQL.update('DELETE FROM job_grades WHERE job_name = ?', {name})
ESX.Jobs[name] = nil
endINSERT IGNORE INTO `items` (`name`, `label`) VALUES
-- Health Parts:
('radiator', 'Radiator'),
('fuel_pump', 'Fuel Pump'),
('brakes', 'Brakes'),
('drive_shaft', 'Drive Shaft'),
('alternator', 'Alternator'),
('clutch', 'Clutch'),
-- Service Parts:
('oil_filter', 'Oil + Filter'),
('air_filter', 'Air Filter'),
('fuel_filter', 'Fuel Filter'),
('coolant', 'Coolant'),
('brake_fluid', 'Brake Fluid'),
('steering_fluid', 'Power Steering Fluid'),
('transmission_fluid', 'Transmission Fluid'),
('spark_plugs', 'Spark Plugs'),
('drive_belt', 'Drive Belt'),
('flywheel', 'Flywheel'),
('tires', 'Tires'),
-- Body Repair Parts:
('part_door', 'Door'),
('part_hood', 'Hood'),
('part_trunk', 'Trunk'),
('part_window', 'Window'),
('part_wheel', 'Wheel'),
-- Kits:
('repairkit', 'Repair Kit'),
('repairkit_adv', 'Repair Kit Advanced'),
('patchkit', 'Patch Kit'),
('carjack', 'Car Jack'),
('fuel_can', 'Fuel Can'),
('jump_starter', 'Jump Starter'),
('tire_repairkit', 'Tire Repair Kit'),
-- Props:
('roadcone', 'Road Cone'),
('toolstrolley', 'Tools Trolley'),
('toolbox', 'Tool Box'),
('enginehoist', 'Engine Hoist'),
('consign', 'Con Sign'),
('roadbarrier', 'Road Barrier'),
-- Materials:
('scrap_metal', 'Scrap Metal'),
('steel', 'Steel'),
('aluminium', 'Aluminium'),
('plastic', 'Plastic'),
('rubber', 'Rubber'),
('electric_scrap', 'Electric Scrap'),
('glass', 'Glass'),
('copper', 'Copper'),
('carbon_fiber', 'Carbon Fiber'),
('brass', 'Brass'),
('synthetic_oil', 'Synthetic Oil'),
('acid', 'Synthetic Acid')
;-- Health Parts | T1GER Mechanic System
['radiator'] = {['name'] = 'radiator', ['label'] = 'Radiator', ['weight'] = 1, ['type'] = 'item', ['image'] = 'radiator.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Health Part - Radiator'},
['fuel_pump'] = {['name'] = 'fuel_pump', ['label'] = 'Fuel Pump', ['weight'] = 1, ['type'] = 'item', ['image'] = 'fuel_pump.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Health Part - Fuel Pump'},
['brakes'] = {['name'] = 'brakes', ['label'] = 'Brakes', ['weight'] = 1, ['type'] = 'item', ['image'] = 'brakes.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Health Part - Brakes'},
['drive_shaft'] = {['name'] = 'drive_shaft', ['label'] = 'Drive Shaft', ['weight'] = 1, ['type'] = 'item', ['image'] = 'drive_shaft.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Health Part - Drive Shaft'},
['alternator'] = {['name'] = 'alternator', ['label'] = 'Alternator', ['weight'] = 1, ['type'] = 'item', ['image'] = 'alternator.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Health Part - Alternator'},
['clutch'] = {['name'] = 'clutch', ['label'] = 'Clutch', ['weight'] = 1, ['type'] = 'item', ['image'] = 'clutch.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Health Part - Clutch'},
-- Service Parts | T1GER Mechanic System
['oil_filter'] = {['name'] = 'oil_filter', ['label'] = 'Oil + Filter', ['weight'] = 1, ['type'] = 'item', ['image'] = 'oil_filter.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Service Part - Oil + Filter'},
['air_filter'] = {['name'] = 'air_filter', ['label'] = 'Air Filter', ['weight'] = 1, ['type'] = 'item', ['image'] = 'air_filter.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Service Part - Air Filter'},
['fuel_filter'] = {['name'] = 'fuel_filter', ['label'] = 'Fuel Filter', ['weight'] = 1, ['type'] = 'item', ['image'] = 'fuel_filter.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Service Part - Fuel Filter'},
['coolant'] = {['name'] = 'coolant', ['label'] = 'Coolant', ['weight'] = 1, ['type'] = 'item', ['image'] = 'coolant.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Service Part - Coolant'},
['brake_fluid'] = {['name'] = 'brake_fluid', ['label'] = 'Brake Fluid', ['weight'] = 1, ['type'] = 'item', ['image'] = 'brake_fluid.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Service Part - Brake Fluid'},
['steering_fluid'] = {['name'] = 'steering_fluid', ['label'] = 'Power Steering Fluid', ['weight'] = 1, ['type'] = 'item', ['image'] = 'steering_fluid.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Service Part - Power Steering Fluid'},
['transmission_fluid'] = {['name'] = 'transmission_fluid', ['label'] = 'Transmission Fluid', ['weight'] = 1, ['type'] = 'item', ['image'] = 'transmission_fluid.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Service Part - Transmission Fluid'},
['spark_plugs'] = {['name'] = 'spark_plugs', ['label'] = 'Spark Plugs', ['weight'] = 1, ['type'] = 'item', ['image'] = 'spark_plugs.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Service Part - Spark Plugs'},
['drive_belt'] = {['name'] = 'drive_belt', ['label'] = 'Drive Belt', ['weight'] = 1, ['type'] = 'item', ['image'] = 'drive_belt.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Service Part - Drive Belt'},
['flywheel'] = {['name'] = 'flywheel', ['label'] = 'Flywheel', ['weight'] = 1, ['type'] = 'item', ['image'] = 'flywheel.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Service Part - Flywheel'},
['tires'] = {['name'] = 'tires', ['label'] = 'Tires', ['weight'] = 1, ['type'] = 'item', ['image'] = 'tires.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Service Part - Tires'},
-- Body Parts | T1GER Mechanic System
['part_door'] = {['name'] = 'part_door', ['label'] = 'Door Part', ['weight'] = 1, ['type'] = 'item', ['image'] = 'part_door.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Body Part - Door'},
['part_hood'] = {['name'] = 'part_hood', ['label'] = 'Hood Part', ['weight'] = 1, ['type'] = 'item', ['image'] = 'part_hood.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Body Part - Hood'},
['part_trunk'] = {['name'] = 'part_trunk', ['label'] = 'Trunk Part', ['weight'] = 1, ['type'] = 'item', ['image'] = 'part_trunk.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Body Part - Trunk'},
['part_window'] = {['name'] = 'part_window', ['label'] = 'Window Part', ['weight'] = 1, ['type'] = 'item', ['image'] = 'part_window.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Body Part - Window'},
['part_wheel'] = {['name'] = 'part_wheel', ['label'] = 'Wheel Part', ['weight'] = 1, ['type'] = 'item', ['image'] = 'part_wheel.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Body Part - Wheel'},
-- Kits | T1GER Mechanic System
['repairkit'] = {['name'] = 'repairkit', ['label'] = 'Repair Kit', ['weight'] = 1, ['type'] = 'item', ['image'] = 'repairkit.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Repair Kit'},
['repairkit_adv'] = {['name'] = 'repairkit_adv', ['label'] = 'Repair Kit Advanced', ['weight'] = 1, ['type'] = 'item', ['image'] = 'repairkit_adv.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Repair Kit Advanced'},
['patchkit'] = {['name'] = 'patchkit', ['label'] = 'Patch Kit', ['weight'] = 1, ['type'] = 'item', ['image'] = 'patchkit.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Patch Kit for health/service parts'},
['carjack'] = {['name'] = 'carjack', ['label'] = 'Car Jack', ['weight'] = 1, ['type'] = 'item', ['image'] = 'carjack.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Car Jack'},
['fuel_can'] = {['name'] = 'fuel_can', ['label'] = 'Fuel Can', ['weight'] = 1, ['type'] = 'item', ['image'] = 'fuel_can.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Fuel Can with fuel'},
['jump_starter'] = {['name'] = 'jump_starter', ['label'] = 'Jump Starter', ['weight'] = 1, ['type'] = 'item', ['image'] = 'jump_starter.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Jump Starter for vehicle battery'},
['tire_repairkit'] = {['name'] = 'tire_repairkit', ['label'] = 'Tire Repair Kit', ['weight'] = 1, ['type'] = 'item', ['image'] = 'tire_repairkit.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Tire Repair Kit for bursted tires'},
-- Prop Emotes | T1GER Mechanic System
['roadcone'] = {['name'] = 'roadcone', ['label'] = 'RoadCone', ['weight'] = 1, ['type'] = 'item', ['image'] = 'roadcone.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Spawn a road cone prop'},
['toolstrolley'] = {['name'] = 'toolstrolley', ['label'] = 'Tools Trolley', ['weight'] = 1, ['type'] = 'item', ['image'] = 'toolstrolley.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Spawn a tools trolley prop'},
['toolbox'] = {['name'] = 'toolbox', ['label'] = 'Tool Box', ['weight'] = 1, ['type'] = 'item', ['image'] = 'toolbox.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Spawn a toolbox prop'},
['enginehoist'] = {['name'] = 'enginehoist', ['label'] = 'Engine Hoist', ['weight'] = 1, ['type'] = 'item', ['image'] = 'enginehoist.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Spawn an engine hoist prop'},
['consign'] = {['name'] = 'consign', ['label'] = 'Consign', ['weight'] = 1, ['type'] = 'item', ['image'] = 'consign.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Spawn a consign prop'},
['roadbarrier'] = {['name'] = 'roadbarrier', ['label'] = 'Road Barrier', ['weight'] = 1, ['type'] = 'item', ['image'] = 'roadbarrier.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Spawn a road barrier prop'},
-- Materials | T1GER Mechanic System
['scrap_metal'] = {['name'] = 'scrap_metal', ['label'] = 'Scrap Metal', ['weight'] = 1, ['type'] = 'item', ['image'] = 'scrap_metal.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Material - Scrap Metal'},
['steel'] = {['name'] = 'steel', ['label'] = 'Steel', ['weight'] = 1, ['type'] = 'item', ['image'] = 'steel.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Material - Steel'},
['aluminium'] = {['name'] = 'aluminium', ['label'] = 'Aluminium', ['weight'] = 1, ['type'] = 'item', ['image'] = 'aluminium.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Material - Aluminium'},
['plastic'] = {['name'] = 'plastic', ['label'] = 'Plastic', ['weight'] = 1, ['type'] = 'item', ['image'] = 'plastic.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Material - Plastic'},
['rubber'] = {['name'] = 'rubber', ['label'] = 'Rubber', ['weight'] = 1, ['type'] = 'item', ['image'] = 'rubber.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Material - Rubber'},
['electric_scrap'] = {['name'] = 'electric_scrap', ['label'] = 'Electric Scrap', ['weight'] = 1, ['type'] = 'item', ['image'] = 'electric_scrap.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Material - Electric Scrap'},
['glass'] = {['name'] = 'glass', ['label'] = 'Glass', ['weight'] = 1, ['type'] = 'item', ['image'] = 'glass.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Material - Glass'},
['copper'] = {['name'] = 'copper', ['label'] = 'Copper', ['weight'] = 1, ['type'] = 'item', ['image'] = 'copper.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Material - Copper'},
['carbon_fiber'] = {['name'] = 'carbon_fiber', ['label'] = 'Carbon Fiber', ['weight'] = 1, ['type'] = 'item', ['image'] = 'carbon_fiber.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Material - Carbon Fiber'},
['brass'] = {['name'] = 'brass', ['label'] = 'Brass', ['weight'] = 1, ['type'] = 'item', ['image'] = 'brass.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Material - Brass'},
['synthetic_oil'] = {['name'] = 'synthetic_oil', ['label'] = 'Synthetic Oil', ['weight'] = 1, ['type'] = 'item', ['image'] = 'synthetic_oil.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Material - Synthetic Oil'},
['acid'] = {['name'] = 'acid', ['label'] = 'Synthetic Acid', ['weight'] = 1, ['type'] = 'item', ['image'] = 'acid.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Material - Synthetic Acid'},-- Health Parts | T1GER Mechanic System
["radiator"] = {
label = "Radiator",
weight = 1,
stack = true,
close = true,
},
["fuel_pump"] = {
label = "Fuel Pump",
weight = 1,
stack = true,
close = true,
},
["brakes"] = {
label = "Brakes",
weight = 1,
stack = true,
close = true,
},
["drive_shaft"] = {
label = "Drive Shaft",
weight = 1,
stack = true,
close = true,
},
["alternator"] = {
label = "Alternator",
weight = 1,
stack = true,
close = true,
},
["clutch"] = {
label = "Clutch",
weight = 1,
stack = true,
close = true,
},
-- Service Parts | T1GER Mechanic System
["oil_filter"] = {
label = "Oil & Filter",
weight = 1,
stack = true,
close = true,
},
["air_filter"] = {
label = "Air Filter",
weight = 1,
stack = true,
close = true,
},
["fuel_filter"] = {
label = "Fuel Filter",
weight = 1,
stack = true,
close = true,
},
["coolant"] = {
label = "Coolant",
weight = 1,
stack = true,
close = true,
},
["brake_fluid"] = {
label = "Brake Fluid",
weight = 1,
stack = true,
close = true,
},
["steering_fluid"] = {
label = "Power Steering Fluid",
weight = 1,
stack = true,
close = true,
},
["transmission_fluid"] = {
label = "Transmission Fluid",
weight = 1,
stack = true,
close = true,
},
["spark_plugs"] = {
label = "Spark Plugs",
weight = 1,
stack = true,
close = true,
},
["drive_belt"] = {
label = "Drive Belt",
weight = 1,
stack = true,
close = true,
},
["flywheel"] = {
label = "Flywheel",
weight = 1,
stack = true,
close = true,
},
["tires"] = {
label = "Tires",
weight = 1,
stack = true,
close = true,
},
-- Body Parts | T1GER Mechanic System
["part_door"] = {
label = "Door",
weight = 1,
stack = true,
close = true,
},
["part_hood"] = {
label = "Hood",
weight = 1,
stack = true,
close = true,
},
["part_trunk"] = {
label = "Trunk",
weight = 1,
stack = true,
close = true,
},
["part_wheel"] = {
label = "Wheel",
weight = 1,
stack = true,
close = true,
},
["part_window"] = {
label = "Window",
weight = 1,
stack = true,
close = true,
},
-- Kits | T1GER Mechanic System
["repairkit"] = {
label = "Repair Kit",
weight = 1,
stack = true,
close = true,
},
["repairkit_adv"] = {
label = "Repair Kit Advanced",
weight = 1,
stack = true,
close = true,
},
["patchkit"] = {
label = "Patch Kit",
weight = 1,
stack = true,
close = true,
},
["carjack"] = {
label = "Car Jack",
weight = 1,
stack = true,
close = true,
},
["fuel_can"] = {
label = "Fuel Can",
weight = 1,
stack = true,
close = true,
},
["jump_starter"] = {
label = "Jump Starter",
weight = 1,
stack = true,
close = true,
},
["tire_repairkit"] = {
label = "Tire Repair Kit",
weight = 1,
stack = true,
close = true,
},
-- Prop Emotes | T1GER Mechanic System
["roadcone"] = {
label = "Road Cone",
weight = 1,
stack = true,
close = true,
},
["toolstrolley"] = {
label = "Tools Trolley",
weight = 1,
stack = true,
close = true,
},
["toolbox"] = {
label = "Tool Box",
weight = 1,
stack = true,
close = true,
},
["enginehoist"] = {
label = "Engine Hoist",
weight = 1,
stack = true,
close = true,
},
["consign"] = {
label = "Con Sign",
weight = 1,
stack = true,
close = true,
},
["roadbarrier"] = {
label = "Road Barrier",
weight = 1,
stack = true,
close = true,
},
-- Materials | T1GER Mechanic System
['scrapmetal'] = {
label = 'Scrap Metal',
weight = 80,
},
["steel"] = {
label = "Steel",
weight = 1,
stack = true,
close = true,
},
["aluminium"] = {
label = "Aluminium",
weight = 1,
stack = true,
close = true,
},
["plastic"] = {
label = "Plastic",
weight = 1,
stack = true,
close = true,
},
["rubber"] = {
label = "Rubber",
weight = 1,
stack = true,
close = true,
},
["electric_scrap"] = {
label = "Electric Scrap",
weight = 1,
stack = true,
close = true,
},
["glass"] = {
label = "Glass",
weight = 1,
stack = true,
close = true,
},
["copper"] = {
label = "Copper",
weight = 1,
stack = true,
close = true,
},
["carbon_fiber"] = {
label = "Carbon Fiber",
weight = 1,
stack = true,
close = true,
},
["brass"] = {
label = "Brass",
weight = 1,
stack = true,
close = true,
},
["synthetic_oil"] = {
label = "Synthetic Oil",
weight = 1,
stack = true,
close = true,
},
["acid"] = {
label = "Synthetic Acid",
weight = 1,
stack = true,
close = true,
},
```ensure ox_lib ## mandatory
ensure ox_inventory ##(or other inventory, ex: qb-inventory)
ensure ox_target ##(or other target, ex: qb-target)
ensure t1ger_lib ## mandatory
ensure t1ger_mechanicsystem ## mandatory
ensure t1ger_carlift ## mandatory