Player interface
When a player connects to your server and the resource is active, the interface is presented automatically according to the configuration you have defined inshared/config.lua.
Notifications
Zyra Store scripts are compatible with ox_lib and also include a native notification system as an alternative. You can switch between the two with theConfig.UseOxLib option in your configuration file.
- If
Config.UseOxLib = true, ox_lib styled notifications will be used. - If
Config.UseOxLib = false, FiveM’s native system will be used as a fallback.
Below you can see how they are implemented in the script code:
client/main.lua
Menus and inputs
Interactive menus and input forms use ox_lib components when enabled, offering a consistent visual experience. If ox_lib is not available, the script will use native alternatives compatible with all servers.Available commands
The following commands are part of the script’s public API. See the complete reference at /en/reference/commands.Player data and menu
You can access the current player’s data and open the main menu using client exports. These exports are the recommended way to interact with the script from another resource or from your own custom scripts.client/main.lua
Inventory interaction
If you have enabled integration with ox_inventory (Config.Features.ox_inventory = true), players will be able to view and interact with items directly from the inventory. Items registered by the script will automatically appear with their corresponding image, weight, and description.
To add or modify items, check theshared/config.luafile under theConfig.Itemssection and make sure you have correctly imported the SQL file included in the resource.
Typical usage flow
The following flow describes a standard player interaction with the script once it is installed and configured on the server:1
The resource starts on the server
When the server starts, the resource triggers the
onResourceStart event, which initializes the configuration and registers connected players.2
The player connects to the server
Upon connecting, the server event
onPlayerConnect is triggered, which registers the player and loads their data. No manual action is required from the player.3
The player opens the main menu
Through the
/script-admin command (administrators) or the access key configured in Config.Keybind, the script’s main menu is opened.4
The player selects an option
Navigate through the available options using the mouse or keyboard. Each option can trigger an action, open a submenu, or request an input. The
onPlayerAction event is emitted every time the player executes an action.5
The server processes the action
The client sends an event to the server, which validates the player’s permissions and executes the corresponding logic on the server side.
6
The player receives a notification
Once the action is completed, the player receives a
success or error notification depending on the result.Ready to take your server to the next level? Check out the Advanced Usage guide to learn how to integrate Zyra Store scripts with other resources through exports, events, and callbacks.
