oxlib
Installation
SKILL.md
ox_lib
Shared FiveM library: UI (notify, dialogs, menus, progress), client/server callbacks, commands and zones via the global lib.
Activation Contract
Load this skill when the user needs notifications, alert or input dialogs, menus, progress bars, TextUI, a client-server request/response, a typed server command, zones ("player enters/leaves area"), keybinds, or any resource that depends on ox_lib.
Hard Rules
- Add
shared_scripts { '@ox_lib/init.lua' }tofxmanifest.luaand ensureox_libstarts before the resource; without itlibis nil. - Prefer
lib.callback/lib.callback.awaitover paired events or framework-specific callbacks for data across the network. lib.callback.register(name, function(source, ...))on the server receivessourcefirst; validate arguments there.- Callback names must be unique (
resourcename:action). - UI functions (
lib.notify,lib.alertDialog,lib.inputDialog,lib.progress,lib.context,lib.menu,lib.showTextUI) render on the CLIENT; from the server trigger the client to call them. - Icons are Font Awesome 6, default style
solid; brand icons use{'fab', 'name'}. lib.addCommandis SERVER-side; userestrictedfor permissions and typedparams(number,playerId,string,longString).- Zones:
onEnter,onExitandinsidedo not work on the server; create zones on the client. Keep the returned zone to callzone:remove(). - Modules load on first use or via
ox_libs { ... }/lib.require.