> ## Documentation Index
> Fetch the complete documentation index at: https://zyra-store.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Basic usage

Zyra Store scripts are designed to integrate seamlessly into your FiveM server. In this guide you will find everything you need to know so your players can interact with the resource from the very first moment: from menus and notifications to available commands and the typical flow of a game session.

***

## 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 in `shared/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 the `Config.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.

The notification system supports four main types:

| Type | Use |
| - | - |
| `success` | Confirm an action completed correctly. |
| `error` | Inform about a failure or disallowed action. |
| `warning` | Warn the player about something important. |
| `info` | Show general information or instructions. |

Below you can see how they are implemented in the script code:

```lua client/main.lua theme={null}
-- Notification with ox_lib (if Config.UseOxLib = true)
lib.notify({
    title   = 'Zyra Store',
    description = 'Action completed successfully.',
    type    = 'success',
    duration = 5000,
})

-- Native FiveM notification (fallback)
SetNotificationTextEntry('STRING')
AddTextComponentString('Action completed successfully.')
DrawNotification(false, false)
```

### 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](https://zyra-store.mintlify.site/en/reference/commands.md).

| Command | Description |
| - | - |
| `/script-admin` | Opens the script administration panel. Requires administrator permissions. |
| `/reload-config` | Reloads the `shared/config.lua` file without restarting the server. |
| `/toggle-feature` | Enables or disables a script feature in real time. |

> [!TIP]
>
> Commands may be restricted by ACE permissions. Make sure players have the correct group assigned in your `server.cfg` to access all 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.

```lua client/main.lua theme={null}
-- Get current player data
local playerData = exports['zyra-mi-script']:GetPlayerData()
print('Player:', playerData.name, '| Identifier:', playerData.identifier)

-- Open the script's main menu
exports['zyra-mi-script']:OpenMenu('main')
```

***

## 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 the `shared/config.lua` file under the `Config.Items` section 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.

***

> [!TIP]
>
> Enable debug mode with `Config.Debug = true` in your `shared/config.lua` to see detailed logs in both the server and client console. This is especially useful during initial setup or when diagnosing problems.

***

Ready to take your server to the next level? Check out the [Advanced Usage](https://zyra-store.mintlify.site/en/guides/advanced-usage.md) guide to learn how to integrate Zyra Store scripts with other resources through exports, events, and callbacks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.