Agency-Repairkit V2 Configuration
Dégâts de véhicule réalistes et quatre kits de réparation pour FiveM, sur QBCore, QBox, ESX ou entièrement en.

01Configuration
Installation rapide · config.lua · Agency-Repairkit V2
--[[ ============================================================================
AGENCY REPAIRKIT V2: CONFIGURATION
----------------------------------------------------------------------------
Every value in this file does something. Framework, inventory and job
lookups live in shared/bridge.lua, which stays readable on escrow
protected servers, so a custom framework only has to be taught there.
============================================================================ ]]
Config = {}
-- =============================================================================
-- 1. GENERAL
-- =============================================================================
-- Language of everything the players see. Shipped with the resource:
-- en, de, fr, es, pt, it, nl, pl, cs, ro, tr, ru, uk, sv, da, fi, hu, hr,
-- el, bg, ja, ko, zh, ar, hi
Config.Locale = 'en'
-- Your own wording for any key from locales/en.lua. It wins over every
-- language file and survives updates, for example:
-- Config.Text = { kit_basic = 'Emergency Kit', warn_dead = 'Motor kaputt' }
Config.Text = {}
-- 'auto' -> QBCore, Qbox or ESX when one of them is installed. Standalone
-- is only chosen when qb-core, qbx_core and es_extended are all
-- missing, so a slowly booting core is never mistaken for none.
-- 'qbcore' -> force QBCore (qb-core) or Qbox (qbx_core)
-- 'esx' -> force ESX (es_extended)
-- 'standalone' -> no framework, see section 10
Config.Framework = 'auto'
-- Notifications go through Agency-Notify when it runs, otherwise through the
-- framework and, standalone, through the game's own ticker.
Config.NotifyTitle = 'Repair Kit'
Config.UseAgencyNotify = true
-- Framework groups that count as admin (QBCore / Qbox permissions, ESX groups).
-- ACE works everywhere: add_ace group.admin agency.repairkit allow
Config.AdminGroups = { 'admin', 'god', 'superadmin' }
-- Prints the detection result and the reason of every refused repair to the
-- server console and F8.
Config.Debug = false
-- =============================================================================
-- 2. INVENTORY AND ITEMS
-- =============================================================================
-- 'auto' -> ox_inventory, qs-inventory or the framework's own inventory
-- (qb-inventory, ps, lj, jpr and other QB forks, ESX)
-- 'ox' | 'qs' | 'framework' to force one of them
Config.Inventory = 'auto'
-- Adds the four kit items to your item list on start when they are missing:
-- QBCore without ox_inventory: at runtime through qb-core, nothing to edit
-- ESX: inserted into the `items` table (needs oxmysql), usable after the
-- next server restart
-- ox_inventory (and therefore Qbox) only reads items from its own
-- data/items.lua: copy the entries from install/ox_inventory.lua there.
-- The item pictures for every inventory are in install/images.
Config.RegisterItems = true
-- =============================================================================
-- 3. KITS
-- =============================================================================
-- One entry per usable item. Percentages are the level a part is brought UP
-- to. A part that is already in better shape is never made worse.
--
-- item inventory item that starts this kit
-- weight item weight in grams, only used by Config.RegisterItems
-- work 'engine' = at the engine bay (bonnet, or boot for rear engines)
-- 'tyre' = kneeling at the flat tyre closest to the player
-- 'body' = anywhere around the vehicle
-- duration seconds of work
-- engine engine health in % after the repair, false = not touched
-- body body health in % after the repair, false = not touched
-- tank fuel tank health in %, false = not touched. A tank above
-- Config.Damage.fuelLeak.below stops leaking.
-- visual true = dents, glass, doors and lights are fixed as well
-- tyre true = fixes the flat tyre the player works at
-- clean true = washes dirt and blood off the vehicle
-- consume true = the kit is used up by a finished repair
-- skillChecks number of skill checks during the work, 0 = none
-- jobs nil = everyone, or a list of jobs, e.g. { 'mechanic' }
-- standalone true = usable without an item on servers without any
-- inventory, from the menu and the target options (section 10)
Config.Kits = {
basic = {
item = 'agencyrepairkit', weight = 1500,
work = 'engine', duration = 12,
engine = 65, body = false, tank = 70, visual = false,
consume = true, skillChecks = 2,
jobs = nil, standalone = true,
},
advanced = {
item = 'agencyrepairkit_advanced', weight = 3000,
work = 'engine', duration = 25,
engine = 100, body = 100, tank = 100, visual = true,
consume = true, skillChecks = 3,
jobs = nil, standalone = false,
},
tyre = {
item = 'agencytyrekit', weight = 2000,
work = 'tyre', duration = 10,
tyre = true,
consume = true, skillChecks = 1,
jobs = nil, standalone = true,
},
cleaning = {
item = 'agencycleaningkit', weight = 800,
work = 'body', duration = 8,
clean = true,
consume = true, skillChecks = 0,
jobs = nil, standalone = true,
},
}
-- =============================================================================
-- 4. REPAIR
-- =============================================================================
Config.Repair = {
distance = 6.0, -- metres the vehicle may be away when a kit is used
walkToSpot = true, -- the player walks to the engine bay or the flat tyre
openHood = true, -- opens the bonnet (boot for rear engines) while working
requireEngineOff = true, -- engine kits only start with the engine off
requireEmpty = true, -- nobody may sit in the driver seat
cancelKey = 73, -- X. Walking away or getting hurt cancels as well.
cancelKeyLabel = 'X',
cooldown = 5, -- seconds between two kits of the same player
-- Vehicle classes no kit works on: 13 cycles, 14 boats, 15 helicopters,
-- 16 planes, 21 trains
blockedClasses = { 13, 14, 15, 16, 21 },
}
-- =============================================================================
-- 5. SKILL CHECK
-- =============================================================================
-- A gold zone on a ring, a needle turns, the player presses the key while the
-- needle is inside the zone. Every kit sets how many checks it asks for.
Config.SkillCheck = {
enabled = true,
key = 38, -- E
keyLabel = 'E',
zone = 55, -- size of the gold zone in degrees, bigger is easier
speed = 0.85, -- needle turns per second
timeout = 4, -- seconds without a key press count as a miss
-- What a miss does:
-- 'retry' -> a new check follows and the repair takes `penalty` seconds longer
-- 'cancel' -> the repair stops, the kit is kept
-- 'break' -> the repair stops and the kit is lost
onMiss = 'retry',
penalty = 3,
maxMisses = 3, -- with 'retry': this many misses stop the repair
loseKit = true, -- true = after maxMisses misses the kit is lost as well,
-- false = the player keeps it and can try again
}
-- =============================================================================
-- 6. MECHANICS
-- =============================================================================
Config.Mechanic = {
-- Jobs that count as mechanic. On QBCore / Qbox every job with
-- type = 'mechanic' counts as well.
jobs = { 'mechanic', 'bennys', 'lsc', 'tuner' },
onDutyOnly = true, -- QBCore / Qbox: only while on duty
speed = 0.6, -- mechanics need 60 % of the time
bonus = 20, -- engine and body end up 20 % higher (never above 100)
noSkillCheck = false, -- true = mechanics skip the skill checks
-- Kits only work while no mechanic is on duty. Mechanics themselves can
-- always use them. Off by default.
onlyWithoutMechanics = false,
minOnDuty = 1, -- this many mechanics on duty block the kits
-- Standalone: players with this ACE count as mechanics.
ace = 'agency.repairkit.mechanic',
}
-- =============================================================================
-- 7. TARGET
-- =============================================================================
-- Adds "use kit" options to every vehicle with ox_target or qb-target,
-- whichever runs. An option only shows for a kit the player carries and when
-- the vehicle needs it.
Config.Target = {
enabled = true,
distance = 2.5,
icon = 'fas fa-screwdriver-wrench',
}
-- =============================================================================
-- 8. DAMAGE SYSTEM
-- =============================================================================
-- Runs for the driver only. It works on the game's own engine, body and tank
-- health, so every HUD that reads those (Agency-Hud does) shows the same state.
Config.Damage = {
enabled = true,
-- Collisions hurt this much more than in plain GTA. 1.0 = unchanged.
multiplier = 1.8,
-- Engine health in % below which a level starts.
levels = { light = 85, medium = 60, heavy = 35, critical = 12 },
-- Engine power per level, 1.0 = full power.
power = { light = 0.95, medium = 0.8, heavy = 0.6 },
-- Misfires: the engine cuts out for a moment while accelerating.
-- Chance per second in %, plus a backfire from the exhaust.
misfire = { enabled = true, medium = 3, heavy = 8, backfire = true },
-- Stalling: a hard hit kills the engine. Chance per hit in %, and the
-- seconds until it catches again.
stall = { enabled = true, medium = 10, heavy = 35, restart = 4 },
-- Below the critical level the engine dies and does not start again until
-- it is repaired. false = GTA decides on its own.
critical = true,
-- Fuel leak: a tank below `below` % loses fuel. `rate` is the loss per
-- minute (in the fuel script's units, usually litres or %) of a fully
-- destroyed tank; a less damaged tank leaks less.
fuelLeak = { enabled = true, below = 65, rate = 12 },
-- Wear under load: flooring an engine at level heavy or worse above `rpm`
-- for `after` seconds costs `loss` % engine health per second.
wear = { enabled = true, rpm = 0.85, after = 3, loss = 0.4 },
-- Small cards on screen when the engine stalls, dies, leaks or overheats.
warnings = true,
-- Vehicle classes the damage system leaves alone.
ignoredClasses = { 13, 14, 15, 16, 21 },
-- Models the damage system leaves alone, e.g. { 'police', 'ambulance' }
ignoredModels = {},
}
-- =============================================================================
-- 9. FUEL SCRIPT
-- =============================================================================
-- Only needed for the fuel leak. 'auto' finds LegacyFuel, ox_fuel, cdn-fuel,
-- ps-fuel, lj-fuel, qs-fuelstations, okokGasStation, lc_fuel and Renewed-Fuel.
-- Anything else uses the game's fuel level, or fill in get and set.
Config.Fuel = {
resource = 'auto',
-- get = function(vehicle) return GetVehicleFuelLevel(vehicle) end,
-- set = function(vehicle, fuel) SetVehicleFuelLevel(vehicle, fuel) end,
}
-- =============================================================================
-- 10. STANDALONE (only used when no framework runs)
-- =============================================================================
--[[ WHAT WORKS WITHOUT A FRAMEWORK
* The whole damage system, and the repair itself with walking, animation,
skill checks, overlay, target options and props everyone can see.
* Kits without an inventory: the Kits tab of /arepairkit and the target
options start every kit with standalone = true, no item needed.
Anyone may use them, or only players with the ACE below.
* With an inventory of your own: fill in the hooks below, or call
exports['Agency-Repairkit']:UseKit(source, 'basic') when the item is used.
* Mechanics are players with the ACE from Config.Mechanic.ace.
WHAT DOES NOT WORK WITHOUT A FRAMEWORK
* Jobs: `jobs` on a kit and the mechanic bonus only know the ACE above.
* Giving kits (Admin tab, console) needs the addItem hook.
]]
Config.Standalone = {
ace = false, -- false = everyone, or an ACE such as 'agency.repairkit.use'
cooldown = 300, -- seconds between two kits per player, only for kits without an item
-- An inventory of your own. hasItem and removeItem make the kits items;
-- addItem is only used for giving kits. Every hook gets the server id.
-- hasItem = function(src, item) return true end,
-- removeItem = function(src, item) return true end,
-- addItem = function(src, item, amount) return true end,
}
-- =============================================================================
-- 11. MENU: /arepairkit, the only command
-- =============================================================================
-- Opens a card with up to three tabs:
-- Vehicle engine, body, tank, tyres and dirt of the vehicle you sit in or
-- stand next to, for everyone
-- Kits every kit with how many you carry and a button to use one
-- Admin give kits to any player, set test damage on the vehicle you
-- drive and repair a vehicle instantly (admins only, section 1)
-- In the server console the same command gives kits:
-- arepairkit give [id] [basic|advanced|tyre|cleaning] [amount]
Config.Menu = {
command = 'arepairkit',
-- Default key, e.g. 'F7'. '' = none; players can still pick a key in
-- Settings > Key Bindings > FiveM.
key = '',
vehicle = true, -- show the Vehicle tab
kits = true, -- show the Kits tab
}
-- =============================================================================
-- 12. INTERFACE
-- =============================================================================
Config.UI = {
style = 'v2', -- 'v2' = the Agency look, 'v1' = the look of Repairkit V1
position = 'bottom', -- 'bottom', 'center' or 'top' for the repair card
scale = 1.0, -- 0.8 to 1.3, 1.0 is made for 1080p and up
diagnosis = true, -- show the vehicle check before the work starts
}
--[[ SETTINGS IN THE GAME
Admins can change these values in the Settings tab of /arepairkit:
Config.UI.style, .position, .scale, .diagnosis
Config.SkillCheck.enabled, Config.SkillCheck.loseKit
Config.Damage.enabled, Config.Damage.warnings
Config.Mechanic.onlyWithoutMechanics
A change applies to every player at once and is kept by the server, also
after a restart or an update. Until "Reset to config.lua" is pressed in
the menu, those saved values win over the ones in this file.
]]
+Bon à savoir
Chaque option de config.lua a un effet, et chaque bloc s'explique dans les commentaires. L'anglais est la langue par défaut, Config.Locale permet de passer à l'une des 25 langues incluses, et Config.Text permet de remplacer des textes isolés.
- Kits (Config.Kits)
- Une entrée par objet : où le joueur travaille (moteur, pneu ou carrosserie), combien de temps cela prend, le pourcentage pour le moteur, la carrosserie et le réservoir, si les bosses, les pneus ou la saleté sont traités, combien de tests d'habileté sont demandés, si l'objet est consommé, quels métiers peuvent l'utiliser et si cela fonctionne sans objet sur un serveur standalone.
- Réparation et test d'habileté
- Config.Repair définit la distance, la marche jusqu'à l'endroit, l'ouverture du capot, le moteur coupé, une place de conducteur libre, la touche d'annulation, un cooldown et les classes de véhicules bloquées. Config.SkillCheck définit la touche, la taille de la zone dorée, la vitesse, le timeout et ce que fait un raté : réessayer avec des secondes en plus, annuler, ou casser le kit. Avec loseKit = true, la valeur par défaut, trois ratés d'affilée font perdre le kit ; false laisse le joueur le garder.
- Mécaniciens et ciblage
- Config.Mechanic liste les métiers de mécanicien, leur vitesse et leur bonus de réparation, s'ils sautent les tests d'habileté, et le verrou optionnel qui bloque les kits pendant que des mécaniciens sont en service. Config.Target active les options ox_target et qb-target et définit leur distance et leur icône.
- Dégâts et carburant
- Config.Damage contient le multiplicateur, les niveaux de dégâts, la puissance par niveau, les ratés d'allumage, les calages, le moteur mort, la fuite de carburant, l'usure sous charge, les cartes d'avertissement, ainsi que les classes et modèles laissés de côté. Config.Fuel permet de choisir le script de carburant ou d'utiliser vos propres fonctions get et set.
- Menu et apparence (Config.Menu, Config.UI)
- Config.Menu définit le nom de la seule commande, une touche par défaut optionnelle et si les joueurs voient les onglets Véhicule et Kits ; les admins reçoivent toujours les onglets Admin et Paramètres. Config.UI.style choisit l'apparence Agency ou l'apparence classique de la V1, en plus de la position et de la taille de la carte de réparation. Les valeurs que les admins modifient dans l'onglet Paramètres l'emportent sur ce fichier jusqu'à ce qu'ils les réinitialisent.
?Questions fréquentes
Comment faire un kit réservé aux mécaniciens ?
Définissez jobs = { 'mechanic' } sur ce kit. Les joueurs ayant un autre métier sont informés que leur métier ne peut pas l'utiliser.
Comment ajouter un cinquième kit ?
Copiez une entrée dans Config.Kits, donnez-lui un nouveau nom et un nouvel objet, puis ajoutez son libellé sous la forme kit_<name> dans Config.Text. Ajoutez l'objet à votre inventaire comme les autres.