oxclient
lib.registerContext / showContext
ox client documentation with a FiveM Lua example.
Summary
Builds and shows a context menu with ox_lib — the modern menu system used by many scripts for clean, themeable menus.
Returns
void
Parameters
contexttable{ id, title, options = { { title, description, onSelect } } }Example
lib.registerContext({
id = 'shop',
title = 'Shop',
options = { { title = 'Buy water', onSelect = function() end } }
})
lib.showContext('shop')Common pitfalls
- Requires ox_lib.
- Register before showing.
- onSelect runs client-side — do sensitive actions via a server event/callback.
Related functions
Related guides
FiveM scripts done right
Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.
Browse Scripts →