API Reference
Internal callbacks and events for the Oxide 3D Weapon Printing system, plus integration guidance for reading progression data from other resources.
Overview
oxide-weaponprinting does not expose any public server exports. All interactions are handled internally through o-link callbacks and FiveM net events. This page lists them for reference — they are designed for internal use and should not be called by other resources.
The supported integration points are the two below: reading progression metadata, and recognizing printed weapons by their item metadata.
Reading a Player's Printing Progression
Progression is stored in character metadata under the weaponprinting key via o-link:
-- From any server resource
local data = olink.character.GetMetadata(source, 'weaponprinting')
if data then
print(data.level) -- Current level (1-10)
print(data.xp) -- Current XP
print(data.totalPrints) -- Lifetime prints collected
print(data.totalAssembled) -- Lifetime weapons assembled
endIdentifying Printed Weapons
Weapons assembled at the bench carry this metadata:
| Field | Type | Notes |
|---|---|---|
printed | boolean | Always true on printed weapons |
registered | boolean | Always false — printed weapons are unregistered ghost guns |
printedBy | string | Character id of the builder |
printedAt | number | Unix timestamp of assembly |
quality | number | Quality percentage |
grade | string | Quality grade name (Poor/Decent/Standard/Quality/Superior) |
durability | number | Only present when Config.Durability.enabled = true; starts equal to quality |
description / display | string / table | Tooltip rendering data |
Blueprint USBs carry metadata.blueprint with the blueprint key.
Server Callbacks
These are registered through the o-link callback bridge (olink.callback.Register) and called internally by this resource's client via olink.callback.Trigger. They are not ox_lib callbacks — lib.callback.await will not reach them. External resources should not invoke them.
| Callback | Purpose |
|---|---|
oxide-weaponprinting:server:getSnapshot | The combined load-time fetch. Returns a single table { printers = {...}, benches = {...}, tables = {...} } scoped to the player's routing bucket. The client runs this once when the player loads and again after a routing-bucket change (see the resync client event below) |
oxide-weaponprinting:server:getPrinters | List printers in the player's routing bucket |
oxide-weaponprinting:server:getBenches | List benches in the player's routing bucket |
oxide-weaponprinting:server:getTables | List tables in the player's routing bucket |
oxide-weaponprinting:server:getPrinterStatuses | Lightweight status info for floating labels |
oxide-weaponprinting:server:enterPrinter / exitPrinter | Lock/unlock a printer while a player uses it |
oxide-weaponprinting:server:getPrinterState | Loaded blueprint, active print, upgrades, malfunction chance |
oxide-weaponprinting:server:getUsbItems | The player's USB items and their blueprints |
oxide-weaponprinting:server:loadUsb | Load a USB (malfunction roll, blueprint storage) |
oxide-weaponprinting:server:selectBlueprint | Switch to a stored blueprint |
oxide-weaponprinting:server:removeBlueprint | Eject a stored blueprint back onto a USB |
oxide-weaponprinting:server:startPrint | Start a print (filament check, level check) |
oxide-weaponprinting:server:cancelPrint | Cancel the active print (no filament refund) |
oxide-weaponprinting:server:collectPrint | Collect a finished print (awards XP) |
oxide-weaponprinting:server:checkRemove | Pre-pickup check (stored blueprint count) |
oxide-weaponprinting:server:installUpgrade | Install an upgrade item on a printer |
oxide-weaponprinting:server:enterBench / exitBench | Lock/unlock a bench while a player uses it |
oxide-weaponprinting:server:getAssemblableWeapons | Weapons the player has the parts and level for |
oxide-weaponprinting:server:startCraft | Start an assembly (consumes parts up-front) |
oxide-weaponprinting:server:completeCraft | Finish an assembly (server-side timer enforced) |
oxide-weaponprinting:server:cancelCraft | Cancel an assembly (parts refunded) |
oxide-weaponprinting:server:getProgression | The player's level/XP stats for the UI |
oxide-weaponprinting:server:getEquippedPrinted | Info about the player's currently equipped printed weapon, or nil. Matches on metadata.printed; durability may be absent when durability is disabled |
Server Events
Net events the client sends to the server. All are validated and rate-limited server-side.
| Event | Payload | Purpose |
|---|---|---|
oxide:weaponprinting:placePrinter | coords, rotation, itemSlot | Place a printer at the confirmed position |
oxide:weaponprinting:removePrinter | printerId, forceRemove | Pick up a printer (force = discard stored blueprints) |
oxide:weaponprinting:placeBench | coords, rotation | Place a weapon bench |
oxide:weaponprinting:removeBench | benchId | Pick up a bench |
oxide:weaponprinting:placeTable | coords, rotation | Place a table |
oxide:weaponprinting:removeTable | tableId | Pick up a table |
oxide:weaponprinting:syncShots | shotCount | Durability sync, sent every Config.Durability.shotSyncInterval shots. Ignored entirely when durability is disabled |
Client Events
Events the server sends to clients.
| Event | Payload | Purpose |
|---|---|---|
oxide:weaponprinting:addPrinter | printerId, data | A printer was placed — spawn it client-side |
oxide:weaponprinting:removePrinter | printerId | A printer was deleted — despawn it |
oxide:weaponprinting:printerLocked / printerUnlocked | printerId | A printer became busy / free |
oxide:weaponprinting:addBench | benchId, data | A bench was placed |
oxide:weaponprinting:removeBench | benchId | A bench was deleted |
oxide:weaponprinting:benchLocked / benchUnlocked | benchId | A bench became busy / free |
oxide:weaponprinting:addTable | tableId, data | A table was placed |
oxide:weaponprinting:removeTable | tableId | A table was deleted |
oxide:weaponprinting:startPlacement | slot, metadata | Begin printer ghost-prop placement (after using the item) |
oxide:weaponprinting:startBenchPlacement | — | Begin bench placement |
oxide:weaponprinting:startTablePlacement | — | Begin table placement |
oxide:weaponprinting:durabilityUpdate | newDurability | The equipped printed weapon's durability changed |
oxide:weaponprinting:weaponBroke | — | The equipped printed weapon hit 0% and was destroyed |
oxide:weaponprinting:openManual | itemImages | Open the Ghost Gunner's Handbook |
oxide:weaponprinting:resync | — | The player's routing bucket changed since their last snapshot — the client refetches getSnapshot and re-syncs its world props to match the new bucket |
Integration Notes
- Progression data: read via
olink.character.GetMetadata(source, 'weaponprinting')— see above. - Printed weapons: identified by
metadata.printed = true. Quality/grade always present;durabilityonly when the durability system is enabled. - Blueprint USBs: carry
metadata.blueprintwith the blueprint key — see Installation > Distributing Blueprint USBs for giving USBs from shops, scripts, or loot tables. - All callbacks and events are validated and rate-limited server-side. External resources should not trigger them directly.
Next Steps
- Features - Understand the systems these APIs power
- Configuration - Customize the settings that affect API behavior
- Troubleshooting - Debug integration issues