SMX logo

SMX Documentation

Production-grade Script Knowledge Base

Build 2026.04 Live Docs



Workstation

Scripts · FiveM Ready

Server Callbacks

esx_advanced_workstation:canAccessStation

Checks station existence and access permissions for current player.

esx_advanced_workstation:getInventory

Returns current inventory map used by crafting UI validation.

esx_advanced_workstation:startCrafting

Starts a craft job after ingredient, distance, access and cooldown checks.

esx_advanced_workstation:finishCraft

Collects a ready craft result after timing and capacity validation.

esx_advanced_workstation:checkActiveCrafting

Returns active/ready crafting entries for station resume state.

Server Events

esx_advanced_workstation:finishCraft

Event-based alias for craft finish flow (internally routes to finish handler).

esx:playerLoaded

Resume hook for ESX/ESXOLD reconnect craft recovery.

QBCore:Server:OnPlayerLoaded

Resume hook for QBCore reconnect craft recovery.

Integration Hook Events

smx-workstation:server:onCraftStart

Triggered when a craft job is created in SQL and successfully started.

smx-workstation:server:onCraftComplete

Triggered after craft reward is granted and DB row is deleted.

smx-workstation:server:onCraftFailed

Triggered for validation/security failures (payload, access, distance, ingredients).

smx-workstation:client:onUiOpened

Client hook when workstation UI is opened.

smx-workstation:client:onUiClosed

Client hook when workstation UI is closed.

Client Events and NUI Callbacks

esx_advanced_workstation:startClientTimer

Pushes active crafting timer updates to NUI.

esx_advanced_workstation:startClientFinish

Signals NUI that craft is ready to collect.

startCrafting / finishCraft / getInventory / close / playSound

Main NUI callbacks used by the frontend workflow.

Exports

exports["smx-workstation"]:OpenStation(stationKey)

Client export to open UI for a specific configured station key.

exports["smx-workstation"]:IsUiOpen()

Client export to check if workstation UI is currently active.

exports["smx-workstation"]:GetStationConfig(stationKey)

Server export returning normalized station definition.

exports["smx-workstation"]:CanPlayerAccessStation(source, stationKey)

Server export validating player access and proximity.