Skip to content

Rexshack-RedM/rsg-gangmenu

Repository files navigation

rsg_framework

💀 rsg-gangmenu

Gang boss management menu for RedM servers using RSG Core.

Platform License

ox_lib–based context menus for gang bosses to manage members, funds, and a shared storage. Uses RSG Core prompts at configured locations, with optional map blips.


🛠️ Dependencies

Interaction: Context prompt at each Config.GangLocations[i].coords opens the main menu (uses exports['rsg-core']:createPrompt).
Key text: Prompt displays the configured key from RSGCore.Shared.Keybinds[Config.Keybind].
Locales: locales/en.json, fr.json, es.json, it.json, el.json, pt-br.json (loaded via lib.locale()).

Command: /gangmenu opens the main gang management menu.


✨ Features (detailed)

🧭 Main Menu (boss only)

  • Manage Members
    • View the Member List.
    • Set grade for a member.
    • Fire a member.
  • Hire Gang Members
    • List nearby civilians and recruit them into your gang.
  • Storage Access
    • Open the shared gang stash (via rsg-inventory), with configurable slots/weight.
  • Money Management
    • View gang balance (server callback).
    • Deposit and Withdraw funds via input dialogs.

Access checks use Player.PlayerData.gang.isboss on client & server.

🗺️ Prompts & Blips

  • For every entry in Config.GangLocations, the script:
    • Creates a prompt at coords to open the gang menu.
    • Optionally spawns a blip when showblip = true with:
      • Config.Blip.blipName
      • Config.Blip.blipSprite
      • Config.Blip.blipScale

💰 Gang Funds (SQL-backed)

  • Uses the management_funds table with type = 'gang'.
  • Server utilities keep an in-memory cache per gang account and persist on change.
  • Exposed server events handle deposit and withdraw, with ox_lib notifications.

📸 Preview

image

📜 Example Config

Config = {}

-- blip settings
Config.Blip = {
    blipSprite = 'blip_honor_bad', -- Config.Blip.blipSprite
    blipScale = 0.2 -- Config.Blip.blipScale
}

-- settings
Config.Keybind = 'J'
Config.StorageMaxWeight = 4000000
Config.StorageMaxSlots = 50

Config.GangLocations = {

    {   -- example
        id = 'gang1',
        name = 'Gang Menu',
        blipname = 'Gang Name',
        coords = vector3(0, 0, 0),
        showblip = false,
        blipforall = false
    },
}

📂 Installation

  1. Place rsg-gangmenu inside your resources (or resources/[rsg]) folder.
  2. Ensure rsg-core, ox_lib, rsg-inventory, and oxmysql are installed and started.
  3. Database: import rsg-gangmenu.sql (creates management_funds with type='gang').
  4. Edit config.lua (keybind, stash sizes, blip & gang locations).
  5. Add to your server.cfg:
    ensure ox_lib
    ensure rsg-core
    ensure rsg-inventory
    ensure rsg-gangmenu

🔐 Permissions

  • Boss‑only actions: The menu and all actions are restricted to gang leaders (Player.PlayerData.gang.isboss).
  • Grade checks: Server-side logic validates grade when managing members (promote/demote/fire).

🗄️ SQL

rsg-gangmenu.sql creates (and seeds) the management_funds table:

CREATE TABLE IF NOT EXISTS `management_funds` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `job_name` VARCHAR(50) NOT NULL,
  `amount`  INT(100) NOT NULL,
  `type` ENUM('boss','gang') NOT NULL DEFAULT 'boss',
  PRIMARY KEY (`id`),
  UNIQUE KEY `job_name` (`job_name`),
  KEY `type` (`type`)
);

-- seed example
INSERT INTO `management_funds` (`job_name`, `amount`, `type`) VALUES
('gang1', 0, 'gang');

🌍 Locales

Provided in locales/: en, fr, es, it, el, pt-br.
Loaded via lib.locale() on both client and server. Menu text & notifications are fully localized.


💎 Credits

  • RSG / Rexshack-RedM and contributors
  • Community testers and translators

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 8

Languages