# T1GER Gang System

<figure><img src="https://2167335559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiDWIMbFBeXle-trOlk%2Fuploads%2F0aYxfVT7KpVE6lnWlcO1%2Fgang_system.png?alt=media&#x26;token=1deee6b4-ea8b-4617-83fb-3b376042551e" alt=""><figcaption></figcaption></figure>

#### [**View on Tebex**](https://store.t1ger.net/package/5579989) | [**CFX Forum Post**](https://forum.cfx.re/t/esx-qb-t1ger-gang-system/5048130) | [**YouTube Showcase**](https://youtu.be/7Twa3zFsxMo) | [**Discord**](https://discord.gg/t1ger)

## Highlights

**Admin Gang Menu** - Create and manage gangs effortlessly in-game. Adjust notoriety and cash, change leadership, or disable/delete gangs as needed.

**Player Gang Menu** - Permission-based menu for members to access action menu or request jobs. Higher-ranked members can manage the gang, invite new members, manage markers and ranks.

**Markers** - Create and manage markers for garage, stash, and cash-locker, accessible with/without pin-code.

**Action Menu** - Perform various actions like zip-tying, escorting, place players in vehicle or trunk, use headbags and taking hostages, all with immersive animations.

**Notoriety System**: Reputation-based system influencing gang activities and interactions. Jobs and gang-related activities will impact the gang's notoriety.

**Rackets** - Claim and compete for control of profitable rackets, such as prostitution racket or protection racket, each with their own job or activity to keep gang-members engaged.

**Drug Sale** - Sell drugs to NPCs with configurable prices, sell chances, and bonus areas. Avoid police alerts to build gang notoriety and maximize profits.

**Customization** - Extensive configurable options in config file(s) and a language file to handle all translations.

**Performance** - Maximum optimization resulting in smooth performance with low resource usage, even on large servers.

**Sync** - Fully synced across all players using OneSync Infinity and statebags.

## Information

### Chat Commands

{% hint style="info" %}
Please note, all these command strings are configurable and can be disabled as well.
{% endhint %}

{% tabs %}
{% tab title="client" %}

<table><thead><tr><th width="186">Command</th><th>Description</th></tr></thead><tbody><tr><td><code>/admingang</code></td><td>Open the admin gang menu.</td></tr><tr><td><code>/gangmenu</code></td><td>Open the player gang menu.</td></tr><tr><td><code>/street</code></td><td>Prints street name at player coords (<code>Config.Debug = true</code>).</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Exports

{% hint style="info" %}
These are available exports in the resource - use them as you please and find necessary.
{% endhint %}

{% tabs %}
{% tab title="client " %}

#### **Admin Gang Menu**

```lua
exports['t1ger_gangsystem']:AdminGangMenu()
```

Void:

* Opens the admin gang menu.

#### **Player Gang Menu**

```lua
exports['t1ger_gangsystem']:PlayerGangMenu()
```

Void:

* Opens the player gang menu.

#### Is Target Ziptied

```lua
exports['t1ger_gangsystem']:IsTargetZiptied(targetId)
```

Parameters:

* The target handle (target server id).

Returns:

* true/false (booleant)

Gets whether the target player is ziptied or not.
{% endtab %}

{% tab title="server" %}

#### Get Gang Data

```lua
exports['t1ger_gangsystem']:GetGangData(id)
```

Paramters:

* The gang handle (gang id).

Returns:

* id, name, notoriety, cash, leader, ranks, members, markers, disabled, rackets (table)

Gets gang data in a table from gang id.

#### Get Player Gang

```lua
exports['t1ger_gangsystem']:GetPlayerGang(playerSrc)
```

Paramters:

* The player handle (player server id).

Returns:

* id, name, notoriety, cash, leader, ranks, members, markers, disabled, rackets, player(array; name, identifier, rank, rankName) (table).

Gets the player's complete gang data in a table.

#### Get Player Gang Id

```lua
exports['t1ger_gangsystem']:GetPlayerGangId(playerSrc)
```

Paramters:

* The player handle (player server id).

Returns:

* gang id or 0 (int)

Gets the player's gang id or 0 if not a member of any gangs.

#### Get Player Gang Rank

```lua
exports['t1ger_gangsystem']:GetPlayerGangRank(playerSrc)
```

Paramters:

* The player handle (player server id).

Returns:

* rank id (int)
* rank name/label (string)

Gets the player's gang rank and rank name/label.&#x20;

#### Get Gang Notoriety

```lua
exports['t1ger_gangsystem']:GetGangNotoriety(id)
```

Paramters:

* The gang handle (gang id).

Returns:

* gang notoriety (int).

Gets the gang's notoriety points.

#### Plus Gang Notoriety

```lua
exports['t1ger_gangsystem']:PlusGangNotoriety(id, amount)
```

Paramters:

* The gang handle (gang id).
* Amount to plus (int).

Adds x amount of points to the current gang notoriety points.

#### Minus Gang Notoriety

```lua
exports['t1ger_gangsystem']:MinusGangNotoriety(id, amount)
```

Paramters:

* The gang handle (gang id).
* Amount to minus (int).

Deducts x amount of points from the current gang notoriety points.

#### **Is Player Zip Tied**

```lua
exports['t1ger_gangsystem']:IsPlayerZiptied(playerSrc)
```

Paramters:

* The player handle (player server id).

Returns:

* The player's zip tied state (boolean).

Gets whether the player is zip tied or not.

#### **Set Player Zip Tied**

```lua
exports['t1ger_gangsystem']:SetPlayerZiptied(playerSrc, bool)
```

Paramters:

* The player handle (player server id).
* set zip tied (true) or remove zip tied (false)

Sets the player's ziptied state. In case you want to stop a player's ziptied state from another resource.
{% endtab %}
{% endtabs %}

### Events

{% hint style="info" %}
These are optional events that you may need to use from other resources to add compatibility.
{% endhint %}

{% tabs %}
{% tab title="client to server" %}

#### Plus Notoriety Points

```lua
TriggerServerEvent('gangsystem:server:plusNotoriety', gangId, points)
```

Paramters:

* The gang handle (gang id) or `nil` (script will find gang id from the source player).
* points to add (int).

Adds x points to the gangs current notoriety points.

#### Minus Notoriety Points

```lua
TriggerServerEvent('gangsystem:server:minusNotoriety', gangId, points)
```

Paramters:

* The gang handle (gang id) or `nil` (script will find gang id from the source player).
* points to deduct (int).

Deducts x points from the gangs current notoriety points.

#### Plus Gang Cash

```lua
TriggerServerEvent('gangsystem:server:plusGangCash', gangId, cashAmount)
```

Paramters:

* The gang handle (gang id) or `nil` (script will find gang id from the source player).
* cash to add (int).

Adds x cash to the gangs cash locker.

#### Minus Gang Cash

```lua
TriggerServerEvent('gangsystem:server:minusGangCash', gangId, cashAmount)
```

Paramters:

* The gang handle (gang id) or `nil` (script will find gang id from the source player).
* cash to deduct (int).

Deducts x cash from the gangs cash locker.
{% endtab %}
{% endtabs %}

## Support

### Common Issues

Before we proceed, please ensure the following:

1. Resource folder of the package is named: `t1ger_gangsystem`.
2. You have not touched nor edited files inside `t1ger_gangsystem/escrow/`.
3. You have not made any custom changes.

{% hint style="success" %}
**TITLE**\
[❓](https://emojipedia.org/question-mark/)  Question/Issue

[✔️](https://emojiguide.com/symbols/check-mark/) Solution/Answer/Instruction
{% endhint %}

### Error Codes

If you getting an error code in your server- or client-console, then please find the error-code from below and fix your issue with the provided instructions.

{% tabs %}
{% tab title="Client" %}

{% endtab %}

{% tab title="Server" %} <mark style="color:red;">**#7983**</mark> - Inside `Config.DrugSale.Items` you've added/edited a key that does not have a reference to `Config.Items` that handles item names for these keys. Please add your key inside `Config.Items` and a respective item name for the key.
{% endtab %}
{% endtabs %}
