Agency Docs
QBESXStandalone

Agency-Repairkit V2 Exports & API

Realistic vehicle damage and four repair kits for FiveM, on QBCore, QBox, ESX or fully standalone.

v2.0.0Paid5 Pages

01Client Exports

ExportDescription
IsRepairing()Returns true while the local player is working on a vehicle, for example to keep your own menu closed.
GetVehicleCondition(vehicle)Engine, body and tank in %, the tyres, the dirt, the damage level and whether the tank leaks. Without an argument it reads the vehicle the player sits in.
OpenMenu()Opens the /arepairkit menu, for example from a phone app or a radial menu.
CloseMenu()Closes the menu and gives the mouse back to the game.
IsMenuOpen()Returns true while the menu is open.

02Server Exports

ExportDescription
UseKit(source, kit)Starts a kit for a player as if the item had been used, with all checks. Returns true, or false and the reason. For custom inventories and shops.
GiveKit(source, kit, amount)Adds kits to a player's inventory through the detected inventory. Returns true on success.
IsRepairing(source)True while that player is working on a vehicle.
GetKits()Every configured kit with its item, label, type of work and duration.
useKit(event, item, inventory, slot, data)The ox_inventory item export. The item entries in install/ox_inventory.lua point to it; it is not meant to be called directly.

03Events

NameSideDescription
agency-repairkit:repairedServerFires on the server with (source, netId, kit) after a repair was finished and the kit was used up. Good for logs, payments or job progress.
agency-repairkit:client:repairedClientFires on the client of the repairing player with (netId, kit) when a repair is done.
agency-repairkit:client:damageLevelClientFires on the driver's client with (level, vehicle) whenever the damage level changes: ok, light, medium, heavy or critical.

+Good to know

Other resources can start kits, give them, ask whether a player is working and read the condition of a vehicle. Three events report finished repairs and changes of the damage level.

Starting Kits from Your Own Code
UseKit(source, kit) runs the same checks as an inventory item: distance, job, cooldown and the item itself. It is the way to connect a custom inventory or a shop NPC.
Reacting to Repairs
agency-repairkit:repaired fires on the server after the kit was used up, with the player, the vehicle's network id and the kit, for example to pay a mechanic or to write a log.

?Frequently asked questions

Can my HUD show the damage level?

Yes. Listen to agency-repairkit:client:damageLevel on the client, or call GetVehicleCondition for engine, body, tank, tyres and the level at any time.

Still stuck after this page? Our support team takes it from here.