shared/integration.lua is the public logging API. From 10.0 the framework bridge (ESX/QB/Qbox/ND, inventory, fuel, revive, player ready) is WebLogsFramework.*. Configure it under My servers → Framework; Adictos_Core is not required.
WebLogsFramework (10.0)
Adictos_WebLogs is self-sufficient: it detects the core and the inventory, gives/removes items, lockers, revive and fuel. Gym / Quest / XP / Zombies do use Adictos_Core; WebLogs doesn’t.
Bridge modules (the public API doesn’t change):
| File | What it does |
|---|---|
shared/framework.lua | Core: detect, player, notify, IC names, Custom |
shared/framework/identifiers.lua | license/steam/multichar format + sync to the panel |
shared/framework/lifecycle.lua | onPlayerLoaded / onPlayerFullyReady |
shared/framework/inventory/bridge.lua | ox / qb / ps / lj provider + give/remove/get |
shared/framework/inventory/stashes.lua | Owner lockers, returns, job stash |
shared/framework/fuel.lua / revive.lua / vehicles.lua | Fuel, revive and garage SQL from the panel |
Use shared/integration.lua, hooks/*.lua and translations for logs. The bridge is configured in the panel or via WebLogsFramework.* / exports.
API summary
| Function / export | Use |
|---|---|
WebLogsFramework.getName() | esx, qb, qbx, nd or custom |
getPlayer / getPlayerByLicense | xPlayer or QB/ND wrapper |
getInventoryProvider() | ox, qb, qs or custom (the resource reports it to the panel) |
addInventoryItem / removeInventoryItem / getInventoryItems | ox or qb CRUD (qs/custom: Custom.* hooks) |
registerOwnedStash / openOwnedStash | Personal locker (returns, APM) |
executePanelRevive | Revive according to the Framework preset |
applyPanelFuelLive / applyPanelRepairLive | Live fuel and repair |
OnPlayerLoaded / OnPlayerFullyReady | Exports: character loaded / ped in the world |
-- Desde otro recurso (WebLogs iniciado)
local fw = WebLogsFramework.getName() -- 'esx' | 'qb' | 'qbx' | 'nd'
local inv = WebLogsFramework.getInventoryProvider() -- 'ox' | 'qb' | …
WebLogsFramework.addInventoryItem(src, 'bread', 2)
WebLogsFramework.notify(src, 'Recibido')
-- Inventario raro (qs/codem): parchea Custom después de que arranque WebLogs
WebLogsFramework.Custom.registerOwnedStash = function(opts) -- tu API
endWebLogsFramework.* / exports. A Cfx/Tebex update may overwrite local changes in the resource’s Lua.Including integration.lua in your resource
Add the file as a shared_script in your resource’s fxmanifest.lua. Server functions (log, logPlayer, listeners) only exist on the server side; on the client you only have AdictosWebLogs.isAvailable().
fx_version 'cerulean'
game 'gta5'
shared_scripts {
'@Adictos_WebLogs/shared/integration.lua',
}
server_scripts {
'server/main.lua',
}ensure Adictos_WebLogs must come first, or at least be started when your resource logs. Check with AdictosWebLogs.isAvailable() or GetResourceState('Adictos_WebLogs') == 'started'.Helper functions
| Function | Description |
|---|---|
AdictosWebLogs.isAvailable() | Returns true if the Adictos_WebLogs resource is started (client and server). |
AdictosWebLogs.log(category, action, data, sendDiscord) | Sends a log to the panel. sendDiscord defaults to true. Server only. |
AdictosWebLogs.logPlayer(source, category, action, data, sendDiscord) | Same as log but fills in the licence and names from the player’s source. Server only. |
AdictosWebLogs.logVehicle(action, source, data, sendDiscord) | Recommended for vehicles. A single function for garage, fuel, repair, transfer and delete. See the dedicated section. |
AdictosWebLogs.onLog(handler) | Listens to every accepted log: handler(category, action, logEntry). |
AdictosWebLogs.onConfigLoaded(handler) | Fires when WebLogs loads the remote configuration from the panel. |
AdictosWebLogs.onCKDone(handler) | Fires when a CK finishes: handler(identifier, success, totalDeleted). |
AdictosWebLogs.onLicenseTransferDone(handler) | Fires when a licence change finishes: handler(oldLicense, newLicense, success, stats). |
exports['Adictos_WebLogs']:ShowPendingWarnings(playerId) | Shows the player the panel warnings they haven’t seen yet (red screen). See the dedicated section below. |
Basic example
local function logVenta(source, plate, precio)
if not AdictosWebLogs.isAvailable() then return end
AdictosWebLogs.logPlayer(source, 'vehicles', 'vehicle_sell', {
details = ('Vendió %s por $%s'):format(plate, precio),
raw_data = { plate = plate, price = precio },
}, true)
endSystem events
The official names are in AdictosWebLogs.Events. You can use them with AddEventHandler or the integration.lua helpers:
| Constant | Event | When it fires |
|---|---|---|
LOG_QUEUED | Adictos_WebLogs:onLogQueued | Every time a log enters the queue (before being sent to the panel). |
LOGS_SENT | Adictos_WebLogs:onLogsSent | After sending a batch of logs to the panel. |
CONFIG_LOADED | Adictos_WebLogs:onConfigLoaded | Remote configuration loaded (categories, CK, etc.). |
CONFIG_UPDATED | Adictos_WebLogs:onConfigUpdated | The panel pushes configuration changes live. |
CK_DONE | Adictos_WebLogs:onCKDone | CK completed from the panel. |
LICENSE_TRANSFER_DONE | Adictos_WebLogs:onLicenseTransferDone | Licence change completed. |
PLAYER_BANNED | adictos:playerBanned | Ban applied from the panel or the sanctions system. |
PERMABAN_REQUEST | adictos:webPermabanRequest | Permaban request from the panel. |
-- Escuchar todos los logs de vehículos
AdictosWebLogs.onLog(function(category, action, entry)
if category ~= 'vehicles' and category ~= 'vehicles_garage' then return end
print(('[WebLogs] %s / %s — %s'):format(category, action, entry.details or ''))
end)
-- O con AddEventHandler directamente
AddEventHandler(AdictosWebLogs.Events.CONFIG_LOADED, function()
print('WebLogs: categorías sincronizadas con el panel')
end)Alternative exports (without integration.lua)
If you don’t want to include the shared file, you can call the resource’s exports or trigger internal network events:
exports['Adictos_WebLogs']:Log('economy', 'payment', { amount = 500, details = 'Pago nómina' }, true)
exports['Adictos_WebLogs']:LogPlayer(source, 'jobs', 'duty_on', { details = 'Entró de servicio' })
-- Mismo efecto vía evento (servidor)
TriggerEvent('Adictos_WebLogs:Log', 'general', 'custom_event', { details = '...' }, false)
-- Lista de eventos disponibles
local events = exports['Adictos_WebLogs']:GetEvents()Log() export also accepts a single object with category, action, license, player_name fields, etc. Useful if you already have a data table built (as in esx_advancedgarage).Unified vehicle API (recommended)
You don’t need AdvancedParking, ox_fuel, esx_advancedgarage or any specific script. Just call logVehicle() from your garage, fuel system or mechanic when the action is completed in the database. WebLogs takes care of the category, the action and the log text.
Available actions
| Action | Constant | When to call it |
|---|---|---|
| Store in garage | store or AdictosWebLogs.VehicleActions.STORE | After marking the vehicle as stored in the DB |
| Take out of garage | retrieve | After spawning the vehicle for the player |
| Repair | repair | After updating engine/body in the DB or entity |
| Fuel | fuel | After changing the fuel level |
| Transfer | transfer | After changing the owner in the DB |
| Delete | delete | After deleting the record from the DB |
<code>data</code> fields
| Field | Description |
|---|---|
plate | Required. Vehicle plate. |
fuel / fuel_before / fuel_after | Fuel level (0–100). |
engine_health / old_engine | Engine health (0–1000 in GTA). |
new_owner / targetLicense / targetName | New owner (transfers). |
details | Free text; if you leave it out, WebLogs generates one automatically. |
via = 'panel' | Marks that the action came from the web panel (staff). |
Example — any garage script (server)
shared_scripts { '@Adictos_WebLogs/shared/integration.lua' }
-- Tras guardar en TU tabla owned_vehicles / player_vehicles:
AdictosWebLogs.logVehicle(AdictosWebLogs.VehicleActions.STORE, source, {
plate = plate,
fuel = fuelLevel,
engine_health = engineHealth,
})
-- Tras sacar del garaje:
AdictosWebLogs.logVehicle('retrieve', source, { plate = plate, engine_health = engineHealth })Example — fuel script (server)
-- Funciona con LegacyFuel, ps-fuel, ox_fuel, CDN-fuel o script propio
RegisterNetEvent('mi_fuel:pagado', function(plate, oldFuel, newFuel)
AdictosWebLogs.logVehicle('fuel', source, {
plate = plate,
fuel_before = oldFuel,
fuel_after = newFuel,
})
end)Example — mechanic / repair
AdictosWebLogs.logVehicle('repair', source, {
plate = plate,
old_engine = engineHealthBefore,
})Example — transfer or delete
AdictosWebLogs.logVehicle('transfer', adminSource, {
plate = plate,
new_owner = newOwnerLicense,
targetName = newOwnerName,
})
AdictosWebLogs.logVehicle('delete', source, { plate = plate })From the client (if the event starts on the client)
-- En client.lua (con integration.lua cargado)
AdictosWebLogs.logVehicle('fuel', {
plate = plate,
fuel_before = 20,
fuel_after = 100,
})Without integration.lua (export only)
exports['Adictos_WebLogs']:LogVehicle('store', source, {
plate = 'ABC 123',
fuel = 75,
engine_health = 900,
})[Panel] prefix. No extra code is needed for that.Live repair / fuel (WebLogsFramework)
When staff press Repair or Fuel in Tickets, Live map or the player profile, WebLogs updates the DB and, if the vehicle is spawned, applies the change in the world. The logic lives in shared/framework/fuel.lua. It is used via WebLogsFramework.*.
Configure the preset under My servers → Manage → Framework → Fuel from the panel (auto, ox_fuel, LegacyFuel, ps-fuel, DB only, etc.).
Server API (<code>WebLogsFramework</code>)
| Function | Description |
|---|---|
getPanelFuelTargetLevel() | 0–100 level configured in the panel (Framework preset). |
applyPanelFuelLive(vehicleHandle, fuelLevel?) | Refuels a spawned vehicle according to the preset (ox_fuel statebag, SetFuel export, custom event or DB only). |
applyPanelRepairLive(vehicleHandle) | Repairs health on the server and triggers the visual/physical fix on all clients. |
updateVehicleFuel(plate, propsJson, fuelLevel?) | UPDATE of the fuel column + JSON props in owned_vehicles / player_vehicles. |
updateVehicleRepair(plate, propsJson) | UPDATE of engine/body in the DB. |
Client API
| Function | Description |
|---|---|
applyClientVehicleFuel(vehicle, fuelLevel, exportResource?) | Applies SetVehicleFuelLevel (and SetFuel if there is an export). Re-applies for several ticks so ox_fuel doesn’t overwrite the level with the native’s old value. |
applyClientVehicleRepair(vehicle) | SetVehicleFixed, deformation, engine/body/tank and dirt. The APM Repair button uses it too. |
Network events
| Event | Parameters | Use |
|---|---|---|
Adictos_WebLogs:panelSetVehicleFuel | netId, fuelLevel, exportResource | Server → clients. Empty exportResource = native/statebag only (ox_fuel). |
Adictos_WebLogs:panelRepairVehicle | netId | Server → clients. Full fix of the streamed vehicle. |
ox_fuel (recommended)
- The
autopreset detectsox_fuelfirst; or force theox_fuelpreset (typestatebag). - Server:
Entity(veh).state:set('fuel', level, true)— ox_fuel’s source of truth. - Clients:
SetVehicleFuelLevelis required if someone is driving; otherwise the ox_fuel loop lowers the tank again withGetVehicleFuelLevel. - Don’t use the client event
ox_fuel:setFuelto raise fuel: on the server it isreduceOnly(it only lowers). - ox_fuel does not export
SetFuel; don’t choose the LegacyFuel preset if you use ox_fuel.
-- Ejemplo: rellenar / reparar un vehículo spawneado desde tu script (servidor)
local veh = -- handle de entidad del vehículo
if veh and DoesEntityExist(veh) then
local level = WebLogsFramework.getPanelFuelTargetLevel()
WebLogsFramework.applyPanelFuelLive(veh, level)
WebLogsFramework.applyPanelRepairLive(veh)
end
-- Cliente (p. ej. menú admin propio)
WebLogsFramework.applyClientVehicleRepair(cache.vehicle)
WebLogsFramework.applyClientVehicleFuel(cache.vehicle, 100)server/map_panel.lua unless you know what the builder changes.Optional integrations (not required)
- esx_advancedgarage — already integrated; it uses
LogVehicleinternally. - AdvancedParking — only affects the live map and automatic deletion; you add the garage/fuel logs yourself with
logVehicle. - Delete hook — optional; detects
DeleteEntitywithout you writing any code (see below).
Vehicle logs — category reference
| Situation | Suggested category | Action (action) | Notes |
|---|---|---|---|
| Send vehicle to the garage | vehicles_garage | vehicle_store | Create the vehicles_garage category in the panel if it doesn’t exist. |
| Take vehicle out of the garage | vehicles_garage | vehicle_retrieve | Same category as storing. |
| Repair vehicle | vehicles | vehicle_repair | Include the plate and engine % before/after in details or raw_data. |
| Add / fill fuel | vehicles | vehicle_fuel | Indicate the previous and new level (0–100). |
| Transfer ownership | vehicles | vehicle_transfer | Use targetLicense / targetName for the new owner. |
| Delete vehicle (own script) | vehicles | vehicle_delete | Use logVehicle('delete', …) or ReportVehicleDelete. |
logVehicle() over building the category and action by hand: that way your logs stay consistent with the panel and with other servers.Automatic delete hook (other resources)
If your resource calls DeleteEntity or DeleteVehicle on cars, you can load the shared hook so WebLogs logs the deletion with your script’s name:
shared_scripts {
'@Adictos_WebLogs/hooks/vehicle_delete_hook.lua', -- después de otros hooks de AP si los hay
}hooks/vehicle_delete_hook.lua). That file goes in files {} of the WebLogs manifest; if it’s missing, the client shows Failed to load script @Adictos_WebLogs/hooks/vehicle_delete_hook.lua. Add Adictos_WebLogs to the dependencies of the resource that loads the hook.WebLogs’ unified monitor merges these reports with AdvancedParking events and “vehicle lost while driving” warnings. Configurable in the panel → My servers → Manage → vehicles tab.
Quick reference of vehicle categories
vehicles— general actions (spawn, delete, get in/out, repair, fuel, transfer…)vehicles_garage— store in and take out of the garagevehicles_engine,vehicles_tuning,vehicles_build— other panel modules (create and enable the ones you use)
ShowPendingWarnings export (in-game warnings)
Shows the player the red warning screen with every panel warning they haven’t acknowledged yet (empty seen_at). If there are several, they appear in the same message (numbered). The player must hold SPACE for a few seconds to mark them as seen.
Useful when under My servers → Manage → Customisation you have “Show warnings automatically” turned off and want to force the notification from your script (jail, admin menu, when leaving a menu, etc.).
-- playerId = source del jugador (server ID de FiveM)
if GetResourceState('Adictos_WebLogs') ~= 'started' then return end
local ok = exports['Adictos_WebLogs']:ShowPendingWarnings(playerId)
if not ok then
-- Jugador offline, ID inválido, o ya hay una petición en curso
print('No se pudieron mostrar avisos pendientes')
end| Parameter / return | Description |
|---|---|
playerId | The player’s source on the server (source). Required |
Returns true | The pending-warnings query to the panel has been launched |
Returns false | Player not connected, invalid ID, or export busy for that player |
Behaviour
- Queries the panel for that licence’s warnings with empty
seen_at. - If there are none pending, nothing is shown.
- If there is 1 warning: “Warning” screen with the reason and the staff member.
- If there are 2 or more: title “Warnings (N)” and combined text
[1/N] …/[2/N] …on the same screen. - When the SPACE hold completes, all the IDs shown become Seen in the panel and are not shown again.
- Works even if the automatic notification toggle is turned off.
Example: on release from jail
RegisterNetEvent('mi_script:playerReleasedFromJail', function()
local src = source
if GetResourceState('Adictos_WebLogs') == 'started' then
exports['Adictos_WebLogs']:ShowPendingWarnings(src)
end
end)AssignCommunityService / SendToCommunityService export
Community service built into Adictos_WebLogs (replaces esx_communityservice). The area, work points, animations and clothing (skinchanger numbers for male/female) are configured under My servers → Manage → Services. You can also place points and capture clothing from /apm with ROPA HOMBRE / ROPA MUJER.
-- Por source (jugador online)
exports['Adictos_WebLogs']:SendToCommunityService(playerId, 10, 'Motivo')
-- Por licencia (panel / scripts)
exports['Adictos_WebLogs']:AssignCommunityService({
license = 'abc123...',
actions = 10,
motivo = 'VDM',
})- Enable the module under Manage → Services and remove
ensure esx_communityservicefromserver.cfg(don’t run both at the same time). - If “Show warning on assignment” is ON, the player sees the red screen with the reason.
- Compatibility (already inside WebLogs): events
esx_serviciocomunitario:sendToCommunityService/esx_communityservice:….
Player loaded / ready (ESX, QBCore and Qbox)
Generic API to know when the character is loaded and when the player is actually ready in the world. Works with or without multicharacter.
There are two levels. Register handlers on the server (WebLogsFramework in shared/framework.lua + shared/framework/lifecycle.lua, or exports):
| Level | API | When |
|---|---|---|
| 1. Character | onPlayerLoaded / IsCharacterLoaded | The core already has the xPlayer / Player (after choosing a character in multichar, or on load without multichar) |
| 2. Ready in the world | onPlayerFullyReady / IsPlayerFullyReady | In addition, the client confirms the ped is active, alive and has valid coordinates |
playerConnecting / playerJoining
│
▼
Multichar (optional) → choose character
│
▼
esx:playerLoaded / QBCore:OnPlayerLoaded / qbx_core:…
│
▼
WebLogsFramework.onPlayerLoaded ← character in framework
│
▼
Client ACK (ped alive + coords)
│
▼
WebLogsFramework.onPlayerFullyReady ← ready in the worldRecommended use
-- Esperar a que el jugador esté jugable (avisos, premios, TP, etc.)
WebLogsFramework.onPlayerFullyReady(function(playerId, meta)
-- meta.alive, meta.coords, meta.framework ('esx' | 'qb' | 'qbx')
print(('Jugador %s listo (%s)'):format(playerId, tostring(meta.framework)))
end)
-- Solo personaje en framework (sin esperar ped)
WebLogsFramework.onPlayerLoaded(function(playerId)
print('Personaje cargado: ' .. playerId)
end)
-- Exports equivalentes (desde otro recurso)
exports['Adictos_WebLogs']:OnPlayerFullyReady(function(src, meta) end)
exports['Adictos_WebLogs']:OnPlayerLoaded(function(src) end)
if exports['Adictos_WebLogs']:IsPlayerFullyReady(src) then
-- ped listo
end
if exports['Adictos_WebLogs']:IsCharacterLoaded(src) then
-- personaje en framework
end| Export / function | Description |
|---|---|
OnPlayerLoaded(handler) | Callback when the character is in the framework |
OnPlayerFullyReady(handler) | Callback when the ped is ready in the world (handler(src, meta)) |
IsCharacterLoaded(src) | Boolean: character loaded |
IsPlayerFullyReady(src) | Boolean: client ACK received |
WebLogsFramework.getName() | Returns esx, qb, qbx, nd or custom |
Options (Custom)
| Option | Default | Use |
|---|---|---|
playerReadyDelayMs | 1500 | Wait after the character loads (multichar / inventory) before requesting the ACK |
playerReadyRequireAlive | true | Requires a living ped + valid coords on the client |
playerReadyTimeoutMs | 600000 | Maximum time waiting for the ACK (ms; internal minimum 30 s) |
onPlayerFullyReady internally, so no UI is shown before the ped exists.playerConnecting / playerJoining to give items or teleport: the character may not exist yet. Prefer onPlayerFullyReady.