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 ox_lib callbacks and FiveM net events. This document lists the internal callbacks and events for reference, but they are designed for internal use by the resource and should not be called externally.

If you need to integrate with the weapon printing system (e.g., checking a player's printing level from another resource), the progression data is stored in player metadata under the weaponprinting key via community_bridge:

-- Reading printing progression from another server resource
local data = Bridge.Framework.GetPlayerMetadata(source, 'weaponprinting')
if data then
    print(data.level)           -- Current level (1-10)
    print(data.xp)              -- Current XP
    print(data.totalPrints)     -- Lifetime prints completed
    print(data.totalAssembled)  -- Lifetime weapons assembled
end

Server Callbacks

These callbacks are registered via lib.callback (ox_lib) and called by the client internally.

oxide-weaponprinting:server:installUpgrade

Installs a printer upgrade component.

-- Called internally by the client NUI
local result = lib.callback.await('oxide-weaponprinting:server:installUpgrade', false, printerId, upgradeType)
-- result: { success = true, upgrades = {...}, stats = {...} } or { error = 'message' }

oxide-weaponprinting:server:getEquippedPrinted

Returns info about the player's currently equipped 3D-printed weapon (if any).

-- Called internally by the client durability module
local weapon = lib.callback.await('oxide-weaponprinting:server:getEquippedPrinted', false)
-- weapon: { slot, name, durability, quality, grade, metadata } or nil

oxide-weaponprinting:server:getTables

Returns all placeable tables in the player's routing bucket.

-- Called internally by the client on load
local tables = lib.callback.await('oxide-weaponprinting:server:getTables', false)
-- tables: { [id] = { coords, rotation, bucket, owner }, ... }

Server Events

oxide:weaponprinting:syncShots

Fired by the client to sync shot counts for durability degradation.

-- Fired every Config.Durability.shotSyncInterval shots
TriggerServerEvent('oxide:weaponprinting:syncShots', shotCount)

oxide:weaponprinting:placeTable

Fired by the client to place a table at the specified position.

TriggerServerEvent('oxide:weaponprinting:placeTable', coords, rotation)

oxide:weaponprinting:removeTable

Fired by the client to pick up a placed table.

TriggerServerEvent('oxide:weaponprinting:removeTable', tableId)

Client Events

oxide:weaponprinting:durabilityUpdate

Sent by the server after processing a durability sync.

RegisterNetEvent('oxide:weaponprinting:durabilityUpdate', function(newDurability)
    -- newDurability: number (0-100)
end)

oxide:weaponprinting:weaponBroke

Sent by the server when a weapon reaches 0% durability and is destroyed.

RegisterNetEvent('oxide:weaponprinting:weaponBroke', function()
    -- Weapon has been removed from inventory
end)

oxide:weaponprinting:printerUnlocked

Broadcast to all clients when a printer is released from use (e.g., player disconnected).

RegisterNetEvent('oxide:weaponprinting:printerUnlocked', function(printerId)
    -- Printer is now available for interaction
end)

oxide:weaponprinting:benchUnlocked

Broadcast to all clients when a bench is released from use.

RegisterNetEvent('oxide:weaponprinting:benchUnlocked', function(benchId)
    -- Bench is now available for interaction
end)

oxide:weaponprinting:removePrinter

Broadcast when a printer is deleted from the world.

RegisterNetEvent('oxide:weaponprinting:removePrinter', function(printerId)
    -- Remove client-side entity and data
end)

oxide:weaponprinting:removeBench

Broadcast when a bench is deleted from the world.

RegisterNetEvent('oxide:weaponprinting:removeBench', function(benchId)
    -- Remove client-side entity and data
end)

oxide:weaponprinting:removeTable

Broadcast when a table is deleted from the world.

RegisterNetEvent('oxide:weaponprinting:removeTable', function(tableId)
    -- Remove client-side entity and data
end)

oxide:weaponprinting:addTable

Broadcast when a new table is placed in the world.

RegisterNetEvent('oxide:weaponprinting:addTable', function(tableId, tableData)
    -- tableData: { coords, rotation, bucket, owner }
end)

oxide:weaponprinting:startTablePlacement

Sent to the client that used a table item to begin ghost-prop placement mode.

RegisterNetEvent('oxide:weaponprinting:startTablePlacement', function()
    -- Enter placement mode
end)

Integration Notes

  • Progression data is stored in player metadata via community_bridge. Use Bridge.Framework.GetPlayerMetadata(source, 'weaponprinting') to read it from other resources.
  • Printed weapons are identified by metadata.printed = true on weapon items in the inventory. They also carry metadata.durability, metadata.quality, and metadata.grade.
  • Blueprint USBs carry metadata.blueprint identifying the weapon blueprint key.
  • All events and callbacks are rate-limited server-side. External resources should not trigger these events directly.