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
end

Identifying Printed Weapons

Weapons assembled at the bench carry this metadata:

FieldTypeNotes
printedbooleanAlways true on printed weapons
registeredbooleanAlways false — printed weapons are unregistered ghost guns
printedBystringCharacter id of the builder
printedAtnumberUnix timestamp of assembly
qualitynumberQuality percentage
gradestringQuality grade name (Poor/Decent/Standard/Quality/Superior)
durabilitynumberOnly present when Config.Durability.enabled = true; starts equal to quality
description / displaystring / tableTooltip 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.

CallbackPurpose
oxide-weaponprinting:server:getSnapshotThe 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:getPrintersList printers in the player's routing bucket
oxide-weaponprinting:server:getBenchesList benches in the player's routing bucket
oxide-weaponprinting:server:getTablesList tables in the player's routing bucket
oxide-weaponprinting:server:getPrinterStatusesLightweight status info for floating labels
oxide-weaponprinting:server:enterPrinter / exitPrinterLock/unlock a printer while a player uses it
oxide-weaponprinting:server:getPrinterStateLoaded blueprint, active print, upgrades, malfunction chance
oxide-weaponprinting:server:getUsbItemsThe player's USB items and their blueprints
oxide-weaponprinting:server:loadUsbLoad a USB (malfunction roll, blueprint storage)
oxide-weaponprinting:server:selectBlueprintSwitch to a stored blueprint
oxide-weaponprinting:server:removeBlueprintEject a stored blueprint back onto a USB
oxide-weaponprinting:server:startPrintStart a print (filament check, level check)
oxide-weaponprinting:server:cancelPrintCancel the active print (no filament refund)
oxide-weaponprinting:server:collectPrintCollect a finished print (awards XP)
oxide-weaponprinting:server:checkRemovePre-pickup check (stored blueprint count)
oxide-weaponprinting:server:installUpgradeInstall an upgrade item on a printer
oxide-weaponprinting:server:enterBench / exitBenchLock/unlock a bench while a player uses it
oxide-weaponprinting:server:getAssemblableWeaponsWeapons the player has the parts and level for
oxide-weaponprinting:server:startCraftStart an assembly (consumes parts up-front)
oxide-weaponprinting:server:completeCraftFinish an assembly (server-side timer enforced)
oxide-weaponprinting:server:cancelCraftCancel an assembly (parts refunded)
oxide-weaponprinting:server:getProgressionThe player's level/XP stats for the UI
oxide-weaponprinting:server:getEquippedPrintedInfo 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.

EventPayloadPurpose
oxide:weaponprinting:placePrintercoords, rotation, itemSlotPlace a printer at the confirmed position
oxide:weaponprinting:removePrinterprinterId, forceRemovePick up a printer (force = discard stored blueprints)
oxide:weaponprinting:placeBenchcoords, rotationPlace a weapon bench
oxide:weaponprinting:removeBenchbenchIdPick up a bench
oxide:weaponprinting:placeTablecoords, rotationPlace a table
oxide:weaponprinting:removeTabletableIdPick up a table
oxide:weaponprinting:syncShotsshotCountDurability sync, sent every Config.Durability.shotSyncInterval shots. Ignored entirely when durability is disabled

Client Events

Events the server sends to clients.

EventPayloadPurpose
oxide:weaponprinting:addPrinterprinterId, dataA printer was placed — spawn it client-side
oxide:weaponprinting:removePrinterprinterIdA printer was deleted — despawn it
oxide:weaponprinting:printerLocked / printerUnlockedprinterIdA printer became busy / free
oxide:weaponprinting:addBenchbenchId, dataA bench was placed
oxide:weaponprinting:removeBenchbenchIdA bench was deleted
oxide:weaponprinting:benchLocked / benchUnlockedbenchIdA bench became busy / free
oxide:weaponprinting:addTabletableId, dataA table was placed
oxide:weaponprinting:removeTabletableIdA table was deleted
oxide:weaponprinting:startPlacementslot, metadataBegin printer ghost-prop placement (after using the item)
oxide:weaponprinting:startBenchPlacementBegin bench placement
oxide:weaponprinting:startTablePlacementBegin table placement
oxide:weaponprinting:durabilityUpdatenewDurabilityThe equipped printed weapon's durability changed
oxide:weaponprinting:weaponBrokeThe equipped printed weapon hit 0% and was destroyed
oxide:weaponprinting:openManualitemImagesOpen the Ghost Gunner's Handbook
oxide:weaponprinting:resyncThe 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; durability only when the durability system is enabled.
  • Blueprint USBs: carry metadata.blueprint with 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