Agency-Repairkit V2 Конфигурация
Реалистичные повреждения автомобиля и четыре ремкомплекта для FiveM, на QBCore, QBox, ESX или полностью standalone.

01Конфигурация
Быстрая установка · 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.
]]
+Полезно знать
Каждая опция в config.lua на что-то влияет, и каждый блок объясняется в комментариях. Английский язык используется по умолчанию, Config.Locale переключает на любой из 25 включённых языков, а Config.Text заменяет отдельные тексты.
- Наборы (Config.Kits)
- Одна запись на предмет: где работает игрок (двигатель, шина или кузов), сколько времени это занимает, процент для двигателя, кузова и бака, устраняются ли вмятины, чинятся ли шины и убирается ли грязь, сколько скилл-чеков требуется, расходуется ли предмет, какие профессии могут его использовать, и работает ли он без предмета на standalone-сервере.
- Ремонт и скилл-чек
- Config.Repair задаёт расстояние, подход к месту ремонта, открытие капота, заглушённый двигатель, свободное водительское сиденье, клавишу отмены, задержку и заблокированные классы автомобилей. Config.SkillCheck задаёт клавишу, размер золотой зоны, скорость, время ожидания и то, что происходит при промахе: повторить с добавлением секунд, отменить или сломать набор. При loseKit = true, значении по умолчанию, три промаха подряд стоят набора; при false игрок сохраняет его.
- Механики и таргет
- Config.Mechanic перечисляет профессии механиков, их скорость и бонус к ремонту, пропускают ли они скилл-чеки, и опциональную блокировку, которая запрещает наборы, пока механики на смене. Config.Target переключает опции ox_target и qb-target и задаёт их дистанцию и иконку.
- Повреждения и топливо
- Config.Damage содержит множитель, уровни повреждений, мощность на каждом уровне, пропуски зажигания, самопроизвольную остановку двигателя, полностью заглохший двигатель, утечку топлива, износ под нагрузкой, предупреждающие карточки, а также классы и модели, которые не затрагиваются. Config.Fuel выбирает топливный скрипт или использует твои собственные функции get и set.
- Меню и оформление (Config.Menu, Config.UI)
- Config.Menu задаёт имя единственной команды, необязательную клавишу по умолчанию и то, видят ли игроки вкладки Автомобиль и Наборы; администраторы всегда получают вкладки Админ и Настройки. Config.UI.style выбирает стиль Agency V2 или классический стиль V1, наряду с позицией и размером карточки ремонта. Значения, которые администраторы меняют во вкладке Настройки, имеют приоритет над этим файлом, пока их не сбросят.
?Частые вопросы
Как сделать набор только для механиков?
Установи jobs = { 'mechanic' } для этого набора. Игрокам с другой профессией будет сказано, что их профессия не может его использовать.
Как добавить пятый набор?
Скопируй запись в Config.Kits, дай ей новое имя и предмет, и добавь её название как kit_<name> в Config.Text. Добавь предмет в свой инвентарь, как и остальные.