> For the complete documentation index, see [llms.txt](https://piotreq-scripts.gitbook.io/piotreq-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://piotreq-scripts.gitbook.io/piotreq-scripts/assets-and-guides/gct/exports.md).

# EXPORTS

1. Open GCT

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

```lua
exports['piotreq_gct']:OpenGCT()
```

{% endtab %}
{% endtabs %}

2. Check if player is in org

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

```lua
exports['piotreq_gct']:inOrg() -- true | false
```

{% endtab %}
{% endtabs %}

3. Update gang stats

{% tabs %}
{% tab title="Server Side" %}

* gang `string`
* stat `string`
* value `number (it will add or remove this value)`
* type `add | remove`

```lua
exports['piotreq_gct']:UpdateGangStat(gang, stat, value, type)

exports['piotreq_gct']:UpdateGangStat('PSC', 'started', 1, 'add')
```

{% endtab %}
{% endtabs %}

4. Get gang stats

{% tabs %}
{% tab title="Server Side" %}

* gangName `string`

```lua
local gangStats = exports['piotreq_gct']:GetGangStats(gangName)
```

{% endtab %}
{% endtabs %}

5. Finish mission (if is started)

{% tabs %}
{% tab title="Server Side" %}

* missionName `string`

```lua
exports['piotreq_gct']:FinishMission(missionName)
```

{% endtab %}
{% endtabs %}

6. Get gang online members

{% tabs %}
{% tab title="Server Side" %}

* gangName `string`

```lua
local gangMembers = exports['piotreq_gct']:GetGangOnlineMembers(gangName)
```

{% endtab %}
{% endtabs %}

7. Get gang all members (offline too)

{% tabs %}
{% tab title="Server Side" %}

* gangName `string`

```lua
local gangMembers = exports['piotreq_gct']:GetGangMembers(gangName)
```

{% endtab %}
{% endtabs %}

8. Get gang data from player identifier

{% tabs %}
{% tab title="Server Side" %}

* identifier `string`

```lua
local playerGang = exports['piotreq_gct']:GetGangFromIdentifier(identifier)
```

{% endtab %}
{% endtabs %}

9. Get gang name and grade from id

{% tabs %}
{% tab title="Server Side" %}

* player `number`

```lua
local playerData = exports['piotreq_gct']:GetPlayerGangData(player)
```

{% endtab %}
{% endtabs %}

10. Add exp for gang

{% tabs %}
{% tab title="Server Side" %}

* gangName `string`
* exp `number`

```lua
exports['piotreq_gct']:AddExpForGang(gangName, exp)
```

{% endtab %}
{% endtabs %}

11. On buy base

{% tabs %}
{% tab title="Server Side" %}

* data `table`

```lua
RegisterNetEvent('piotreq_gct:onBuyBase', function(data)
    print(json.encode(data))
end)
```

{% endtab %}
{% endtabs %}
