# nova\_grupos

NOVA Framework groups/gangs system. Full organization management with roles, bank, stash, uniforms, radio frequencies, and farming activities.

## Features

* **Group Management** — Create, edit, disband organizations
* **Role Hierarchy** — Leader, Co-Leader, Gerente, Elite, Recrutador, Membro, Novato
* **Group Bank** — Deposit and withdraw funds
* **Invites** — Invite players to join with expiry timer
* **Kick & Promote** — Manage members within the organization
* **Uniforms** — Save and equip group uniforms
* **Radio Frequencies** — Dedicated radio channels per group
* **Group Stash** — Shared inventory storage
* **Bases** — Group HQ locations with map blips
* **Farm Activities** — Cocaine, weed, meth, guns, armor production
* **XP System** — Earn XP from kills, sprays, playtime
* **Admin Panel** — Create, delete, edit groups via admin interface

## Configuration

Edit `config.lua`:

```lua
GruposConfig = {
    Roles = {
        'novato', 'membro', 'recrutador',
        'elite', 'gerente', 'co-leader', 'leader'
    },

    Permissions = {
        invite = 'recrutador',
        kick = 'gerente',
        withdraw = 'gerente',
        promote = 'co-leader',
        uniform = 'elite',
        radio = 'membro',
        settings = 'leader',
        disband = 'leader',
    },

    Limits = {
        MaxMembers = 30,
        MaxNameLength = 24,
        MaxBankDeposit = 100000,
        MaxBankWithdraw = 50000,
        InviteExpiry = 300,        -- 5 minutes
        MaxRadioFreqs = 3,
        MaxUniforms = 5,
    },

    Admin = {
        Permission = 'admin',
        Command = 'gangadmin',
        CommandOpen = 'gangs',
    },
}
```

### Role Hierarchy

| Grade | Role       | Description                      |
| ----- | ---------- | -------------------------------- |
| 0     | Novato     | New member, limited permissions  |
| 1     | Membro     | Standard member                  |
| 2     | Recrutador | Can invite new members           |
| 3     | Elite      | Can manage uniforms              |
| 4     | Gerente    | Can kick members and manage bank |
| 5     | Co-Leader  | Can promote members              |
| 6     | Leader     | Full control, can disband group  |

### Permission Matrix

| Action        | Minimum Role |
| ------------- | ------------ |
| Invite        | Recrutador   |
| Kick          | Gerente      |
| Bank Withdraw | Gerente      |
| Promote       | Co-Leader    |
| Uniforms      | Elite        |
| Radio         | Membro       |
| Settings      | Leader       |
| Disband       | Leader       |

## Dependencies

* **nova\_core** — Player data, jobs/gangs system
* **oxmysql** — Database operations

## Notes

* Groups are stored in the database with full persistence
* The admin panel allows server staff to manage all groups
* Farm activities have cooldowns and require the player to be at specific locations
* XP contributes to a group leaderboard
* The NUI provides a modern interface for all group management operations

## Security

* All actions are validated server-side with permission checks
* Event names and internal implementation details are not disclosed in this documentation for security purposes
* Unauthorized access attempts are logged
