SMX logo

SMX Documentation

Production-grade Script Knowledge Base

Build 2026.04 Live Docs



Inventory

Scripts · FiveM Ready

Server Callbacks

Returns player inventory and resolved secondary container payload for UI open/refresh.

smx-inventory:getInventoryData

Resolves configured world storage by id and checks access before opening.

smx-inventory:server:requestConfiguredStorage

Server Events (Receive)

Initial sync request for current ground drops.

smx-inventory:server:requestGroundDrops

Handles using inventory items (weapons, attachments, ammo, boxes, repair items).

smx-inventory:server:useItem

Processes durability/ammo shot tracking per fired weapon.

smx-inventory:server:weaponShotFired

Drops item stack at player coordinates into ground container runtime/DB.

smx-inventory:server:dropItem

Transfers item stack or weapon to target player id.

smx-inventory:server:giveItem

Core move handler for player, trunk, glovebox, stash and ground moves.

smx-inventory:server:moveItem

Client Events (Receive)

smx-inventory:client:equipWeapon

Equips selected weapon and reapplies saved components.

smx-inventory:client:weaponBroken

Forces unarmed state when durability reaches broken state.

smx-inventory:client:clearAllWeapons

Removes all player weapons (admin clear flow).

smx-inventory:client:setWeaponAmmo

Sets synced ammo value for weapon.

smx-inventory:client:applyWeaponComponents

Applies saved weapon components after sync.

smx-inventory:client:refresh

Refreshes currently open UI data.

smx-inventory:client:openStash

Opens stash-style secondary inventory by id.

smx-inventory:client:openConfiguredStorage

Opens configured static storage payload.

smx-inventory:client:syncGroundDrops

Updates local ground drop cache from server.

smx-inventory:client:useFromEsx

Client-side bridge call for usable items.

NUI Callbacks

close

Close inventory UI.

getNearbyPlayers

Returns nearby players (plus configured give-test NPC targets).

useItem

Triggers server use logic for selected item.

dropItem

Drops item stack to ground container.

giveItem

Gives item directly to target id.

startGiveSelect

Starts crosshair-based target selection mode.

moveItem

Moves items between all supported inventories.

Exports and Commands

exports['smx-inventory']:OpenStash(playerId, stashId, label, maxWeight, slots)

Server export to open custom stash context for player.

exports['smx-inventory']:OpenStorage(playerId, storageId, label, maxWeight, slots)

Server export alias for opening storage context.

exports['smx-inventory']:OpenConfiguredStorage(playerId, storageId)

Server export to open storage from Config.Storages.

exports['smx-inventory']:OpenStorage(storageId, label, maxWeight, slots)

Client export for opening stash/storage locally.

exports['smx-inventory']:OpenConfiguredStorage(storageId)

Client export for configured storage by id.

/admingiveitem /adminremoveitem /admingiveweapon /adminremoveweapon /clearinv

Administrative inventory and weapon maintenance commands.