DXS STORE SYSTEM

DXS Store System
A comprehensive and interactive store system for FiveM, featuring a shopping trolley, category markers, a web-based UI, and integration with ox_inventory for item management and es_extended for player data and economy. This system supports multiple customizable shops, shop ownership, employee management, and a full Point of Sale (POS) system with self-checkout capabilities.
Features
Multiple Customizable Shops: Define various shops with unique IDs, labels, purchase prices, and item markups.
Shop Ownership: Players can purchase and own shops, gaining access to a boss menu for management.
Employee Management: Shop owners can hire and fire employees who can operate the POS system.
Shopping Trolley System: Optional trolley requirement for shopping, with interactive animations.
Category Markers: 3D markers for different item categories within each shop, enhancing navigation.
Web-based UI (NUI): Modern and interactive user interface for browsing items, managing the cart, and checkout.
Full Point of Sale (POS) System:
Cashier interface for employees/owners to process customer payments.
Self-checkout option for customers with items in their cart.
Discount application (percentage or flat rate).
Support for multiple payment methods (cash, card).
Transaction logging.
Inventory Integration: Seamlessly integrates with
ox_inventoryfor adding purchased items to player inventories.ESX Integration: Utilizes
es_extendedfor player data, economy, and notifications.Persistent Data: Shop states, transactions, and employee data are stored in a database.
Blips: Shops are marked on the map with customizable blips.
Requirements
A compatible database (e.g., MySQL with
oxmysqlorMySQL.Async)
Installation
Clone or Download: Place the
DXS_storesystemfolder into your FiveMresourcesdirectory.Database Setup:
Import
database.sqlinto your MySQL database. This will create the necessary tables for shops, transactions, and employees.
Start Resource: Add
ensure DXS_storesystemto yourserver.cfg.Dependencies: Ensure
es_extendedandox_inventoryare started beforeDXS_storesystemin yourserver.cfg.ensure es_extended ensure ox_inventory ensure DXS_storesystem
Configuration
The main configuration is done in config.lua.
Config.RequireTrolleyForShopping: Set totrueif players must use a trolley to shop.Config.CategoryMarkerDefaults: Customize the appearance of category markers (draw distance, type, scale, color).Config.CategoryMenu: Configure the title and alignment of the category selection menu.Config.CheckoutMenu: Configure the title and button labels for the checkout menu.Config.Checkout:brand: Brand name for the POS system.currencySymbol: Symbol used for currency display.locale: Locale for currency formatting.taxRate: Sales tax rate (e.g.,0.05for 5%).paymentMethods: Available payment methods (e.g.,{'cash', 'card'}).employeeDiscountPercent: Default discount for employees.discountLimits: Maximum percentage and flat discounts allowed.
Config.TrolleyModel: Specify the model name for the shopping trolley.Config.Shops: This is a table where you define each individual shop. Each shop entry includes:id: Unique identifier for the shop.label: Display name of the shop.purchasePrice: Price for a player to purchase the shop.markup: Price increase for items sold in this shop (e.g.,0.10for 10% increase).purchaseCoords: Coordinates where players can purchase the shop.blip: Blip settings (sprite, color, scale) for the shop on the map.purchaseMarker,trolleyMarker,checkoutMarker: Marker settings (coords, text, type, scale, color) for interaction points.categories: A table of item categories available in the shop. Each category has:id: Unique identifier for the category.label: Display name of the category.coords: Coordinates for the category marker.text: Text displayed when near the category marker.items: A list of items within the category, each withname,label, andprice.
Usage
Player Experience
Locate a Shop: Find a shop blip on the map.
Purchase a Shop (Optional): If a shop is unowned, approach the purchase marker and press
Eto buy it.Get a Trolley (if required): If
Config.RequireTrolleyForShoppingistrue, interact with the trolley marker to get a shopping trolley.Browse Categories: Approach category markers within the shop and press
Eto open the shopping UI.Add to Cart: Select items from the UI to add them to your shopping cart.
Checkout:
Self-Checkout: If no employee is available, approach the checkout marker with items in your cart and press
Efor self-checkout.Cashier Checkout: An employee or owner can process your payment at the POS.
Boss Menu (for Owners): Owners can access a boss menu at the purchase marker to manage funds, employees, and shop logo.
Shop Owner/Employee Experience
Access POS: Approach the checkout marker and press
Eto open the POS system.Process Payments: As a cashier, you can select a customer's cart, apply discounts, and process payments (cash or card).
Manage Shop (Owners Only): At the purchase marker, owners can access the boss menu to:
Withdraw/deposit funds from the shop's account.
Hire and fire employees.
Update the shop's logo URL.
Database Structure
The script uses the following tables:
dxs_storesystem_shops:id(VARCHAR): Unique shop identifier.label(VARCHAR): Display name of the shop.purchase_price(INT): Price to purchase the shop.markup(FLOAT): Item price markup for the shop.owner_identifier(VARCHAR): Identifier of the shop owner.owner_name(VARCHAR): Name of the shop owner.funds(INT): Current funds in the shop's account.logo_url(VARCHAR): URL for the shop's logo.created_at(TIMESTAMP): Timestamp of shop creation.
dxs_storesystem_transactions:id(INT, AUTO_INCREMENT): Unique transaction ID.shop_id(VARCHAR): ID of the shop where the transaction occurred.type(VARCHAR): Type of transaction (e.g., 'Deposit', 'Withdraw', 'Sale').amount(INT): Amount of the transaction.employee_name(VARCHAR): Name of the employee who processed the transaction (or 'System').timestamp(TIMESTAMP): Timestamp of the transaction.
dxs_storesystem_employees:id(INT, AUTO_INCREMENT): Unique employee ID.shop_id(VARCHAR): ID of the shop the employee works for.identifier(VARCHAR): Player identifier of the employee.name(VARCHAR): Name of the employee.role(VARCHAR): Role of the employee (e.g., 'employee', 'owner').hire_date(TIMESTAMP): Timestamp when the employee was hired.
Credits
DXS for the original script.
ESX Framework for the base.
ox_inventory for inventory management.
Last updated