LV Soft FiveM
  • LV SOFT
    • 👋Welcome!
    • 🛒Tebex
    • 💬Discord
  • QB/ESX
    • ☮️lvs-loading
      • Installation
      • Configuration
    • 👫lvs-multichar
      • Installation
      • Configuration
      • Adding Scenes
      • Tebex Integration
      • Commands
    • 🗺️lvs-spawnselector
      • Installation
      • Configuration
    • 🥼lvs-clothing
      • Installation
        • QBCore Install
        • ESX Install
      • Configuration
      • Migration
        • qb-clothing
        • esx-skinchanger
        • Illenium-Appareance
      • Blacklisting
      • Events
      • Commands
    • ⚙️lvs-lib
      • black-screen loading
      • notifications
      • progressbar
      • key-interaction
      • textui
      • alert
      • context menu
      • context input
    • 💬lvs-chat
      • Installation
      • Configuration
      • Events & Exports
    • 📱lvs-radio
      • Installation
      • Configuration
      • Events & Exports
    • 🗃️lvs-playerlist
      • Installation
      • Configuration
    • 📹lvs_weazelnews
      • Installation
      • Configuration
    • 🎒lvs-inventory
      • Installation
      • Configuration
      • lvs-inventory
        • exports
      • lvs-shops
        • Configuration
        • Exports
      • lvs-crafting
    • 🪪lvs-idmanager
      • Installation
      • Configuration
      • Exports
  • Standalone
    • 🚘lvs-drift
      • Installation
      • Configuration
      • Commands
    • 🕺lvs-animations
      • Installation
      • Configuration
      • Adding Animations
      • Exports/Events
    • 💥lvs-accident
      • Installation
      • Configuration
    • 🔥lvs-explosion
      • Installation
      • Configuration
    • 🏎️lvs-racing
  • ESX
    • 📅Soon
Powered by GitBook
On this page
  • Export: exports.lvs_shops:RegisterShop
  • Event: lvs_shops:client:openRuntimeShop
  • Notes
  1. QB/ESX
  2. lvs-inventory
  3. lvs-shops

Exports

This script allows registering and opening dynamic shops on your FiveM server using simple exports and events.


Export: exports.lvs_shops:RegisterShop

Syntax (server-side)

exports.lvs_shops:RegisterShop(shopId, shopData)

Parameters

  • shopId (string): A unique identifier for the shop.

  • shopData (table): A table containing the shop's settings and inventory.

shopData Structure

  • name (string): Display name of the shop.

  • inventory (table): A list of items available in the shop. Each item should be a table with:

    • name (string): Item name.

    • price (number): Item price.

    • type (string, optional): Item type (for categorization or filtering).

  • groups (table): Restriction list based on player groups (e.g., police = 0 for group access).

  • description (string, optional): A short description of the shop.

  • filters (table, optional): Used to organize shop items by categories. Each filter is a table with:

    • type (string): The item type this filter applies to.

    • label (string): Display label for the filter.

    • description (string): Additional description for the filter.

    • icon (string): Icon for the filter (currently not implemented).

Example Usage

exports.lvs_shops:RegisterShop('TestShop', {
    name = 'Test shop',
    inventory = {
        { name = 'burger', price = 10, type = 'drink' },
        { name = 'water', price = 10, type = 'drink' },
        { name = 'cola', price = 10, type = 'drink' },
    },
    groups = {
        police = 0
    },
    description = 'Some description bla bla',
    filters = {
        {
            type = 'drink',
            label = 'Drinks',
            description = 'Something refreshing',
        }
    },
})

Event: lvs_shops:client:openRuntimeShop

Syntax (client-side)

TriggerEvent('lvs_shops:client:openRuntimeShop', shopId)

Parameters

  • shopId (string): The ID of the shop you registered previously.

Description

This client-side event opens the specified runtime shop UI for the player.

Example Usage

TriggerEvent('lvs_shops:client:openRuntimeShop', 'TestShop')

Notes

  • shopId must be unique when registering a new shop to avoid conflicts.

  • You can expand the shopData with more optional fields like in shops.lua of lvs_shops if needed.

  • Group restrictions (groups) allow you to make certain shops accessible only to specific player groups or jobs.

PreviousConfigurationNextlvs-crafting

Last updated 11 days ago

🎒