Electus Gangs Exports
Exports for integrating Electus Gangs with your own FiveM scripts, with parameters and usage.
Client Exports
Get Player Zone
Get the current zone ID of the player.
exports["electus_gangs"]:GetPlayerZone()Returns: number - The ID of the player's current zone.
Get Player Gang ID
Get the ID of the player's gang.
exports["electus_gangs"]:GetPlayerGangId()Returns: number - The ID of the player's gang.
Server Exports
Get Gang
Get the details of a specific gang by its ID.
exports["electus_gangs"]:GetGang(gangId)| Prop | Description | Type |
|---|---|---|
| gangId | The ID of the gang to retrieve. | number |
Returns: table - The specifics of the gang identified by gangId.
Get Gang Level
Get the level of a specific gang.
exports["electus_gangs"]:GetGangLevel(gangId)| Prop | Description | Type |
|---|---|---|
| gangId | The ID of the gang whose level is to be retrieved. | number |
Returns: number - The level of the gang.
Get Source Zone Id
Retrieves the source zone ID.
exports["electus_gangs"]:GetSourceZoneId(src)| Prop | Description | Type |
|---|---|---|
| src | The source of player for which the zone ID is being retrieved. | number |
Returns: number - The ID of the source zone. |
Get Gang From Zone Id
Retrieves the gang data from a specific zone ID.
exports["electus_gangs"]:GetGangFromZoneId(zoneId)| Prop | Description | Type |
|---|---|---|
| zoneId | The ID of the zone for which the gang data is being retrieved. | number |
Returns: table - A table containing the gang data for the specified zone ID. |
Get Source Gang ID
Get the gang ID associated with a player's source identifier.
exports["electus_gangs"]:GetSourceGangId(src)| Prop | Description | Type |
|---|---|---|
| src | The source identifier, the player's server ID. | number |
Returns: number - The gang ID associated with the source.
Get Gang From Zone ID
Get the gang that controls a specific zone.
exports["electus_gangs"]:GetGangFromZoneId(zoneId)| Prop | Description | Type |
|---|---|---|
| zoneId | The ID of the zone for which the controlling gang is to be retrieved. | number |
Returns: number or nil - The gang ID controlling the zone identified by zoneId, or nil if no gang controls it.
Change Gang Reputation
Modifies the reputation of a gang by a specified amount.
exports["electus_gangs"]:ChangeGangRep(gangId, change)| Prop | Description | Type |
|---|---|---|
| gangId | The ID of the gang whose reputation is to be modified. | number |
| change | The amount to change the reputation by. | number |
Get Gang Owned Zones
exports["electus_gangs"]:GetGangOwnedZones(gangId)| Prop | Description | Type |
|---|---|---|
| gangId | The ID of the gang whose owned zones are to be retrieved. | number |
Returns: table - A list of zones owned by the gang identified by gangId.
Get Zone Respect
Get the respect level of a specific zone.
exports["electus_gangs"]:GetZoneRespect(zoneId)| Prop | Description | Type |
|---|---|---|
| zoneId | The ID of the zone for which respect is to be retrieved. | number |
Returns: number - The respect level of the zone.
Gain XP
Add experience points (XP) to a gang.
exports["electus_gangs"]:GainXP(gangId, xp)| Prop | Description | Type |
|---|---|---|
| gangId | The ID of the gang to which XP is being added. | number |
| xp | The amount of XP to be added to the gang. | number |
Create Alert Create an alert for a specific gang.
exports["electus_gangs"]:CreateAlert(gangId, label, message, coords)| Prop | Description | Type |
|---|---|---|
| gangId | The ID of the gang for which the alert is created. | number |
| label | The label for the alert. | string |
| message | The message content of the alert. | string |
| coords | The coordinates where the alert is relevant. | vector3 |
Add Progress To Capture
Adds progress to a zone capture for a specific gang. Can be used in drug scripts, heist etc. Once it hits the required amount, the zone will be captured. Make sure to add the type to Config.capturing.captureProgressTypes
exports["electus_gangs"]:AddProgressToCapture(name, zoneId, gangId, amount)| Prop | Description | Type |
|---|---|---|
| gangId | The ID of the gang for which progress is being added. | number |
| zoneId | The ID of the zone being captured. | number |
| name | The name/type of capture ("drugCapture", "graffiti", "custom" etc). | string |
| amount | The amount of progress to add to the capture. | number |
Remove Progress From Capture
Removes progress from a zone capture for a specific gang.
exports["electus_gangs"]:RemoveProgressFromCapture(zoneId, gangId, amount)| Prop | Description | Type |
|---|---|---|
| gangId | The ID of the gang for which progress is being removed. | number |
| zoneId | The ID of the zone being captured. | number |
| amount | The amount of progress to remove from the capture. | number |
Create Task
Creates a new task for a specific gang.
exports["electus_gangs"]:CreateTask(gangId, taskName, label, description, xpReward, minLevel, goalProgress, shouldRemove)| Prop | Description | Type |
|---|---|---|
| gangId | ID of gang OR nil for all gangs. | number or nil |
| taskName | The name identifier of the task. | string |
| label | The label for the task. | string |
| description | A brief description of the task. | string |
| xpReward | The amount of XP to reward for completing the task. | number |
| minLevel | The minimum level required to start the task. | number |
| goalProgress | The progress required to complete the task. | string |
| shouldRemove | Whether the task should be removed after completion. If not the gang can't redo the same task | boolean |
Add Task Progress
Adds progress to an existing task for a specific gang.
exports["electus_gangs"]:AddTaskProgress(gangId, taskName, amount)| Prop | Description | Type |
|---|---|---|
| gangId | ID of gang OR nil for all gangs. | number or nil |
| taskName | The name identifier of the task. | string |
| amount | The amount of progress to add to the task. | number |
Get Active Tasks Data
Retrieves the active tasks for a specific gang.
exports["electus_gangs"]:GetActiveTaskData(gangId, taskName)| Prop | Description | Type |
|---|---|---|
| gangId | ID of gang OR nil for all gangs. | number or nil |
| taskName | The name identifier of the task. | string |
Returns: table - A table containing the active tasks data for the specified gang and task name. |
Add War Progress
Adds progress to a war between two gangs.
exports["electus_gangs"]:AddWarProgress(gangId, targetGangId, progress)| Prop | Description | Type |
|---|---|---|
| gangId | ID of gang OR nil for all gangs. | number or nil |
| targetGangId | The ID of the target gang. | number |
| progress | The amount of progress to add to the war. | number |
Get Zone By Id
Retrieves a zone by its ID.
exports["electus_gangs"]:GetZoneById(id)| Prop | Description | Type |
|---|---|---|
| id | The ID of the zone to retrieve. | number |
Returns: table - The zone with the specified ID. |
Init Zone Type
Initializes a new custom zone type.
exports["electus_gangs"]:InitZoneType(name, label, description)| Prop | Description | Type |
|---|---|---|
| name | The name of the zone type. | string |
| label | The label for the zone type. | string |
| description | A brief description of the zone type. | string |
Get Role Grade From Id
Retrieves a role grade by its ID.
exports["electus_gangs"]:GetRoleGradeFromId(roleId)| Prop | Description | Type |
|---|---|---|
| roleId | The ID of the role grade to retrieve. | number |
Returns: number - The role grade with the specified ID. |
Get Permissions From Role
Retrieves the permissions associated with a specific role.
exports["electus_gangs"]:GetPermissionsFromRole(roleId)| Prop | Description | Type |
|---|---|---|
| roleId | The ID of the role to retrieve permissions for. | number |
Returns: table - A table containing the permissions associated with the specified role. |
Get Player Member Grade
Retrieves the grade of a player's gang member.
exports["electus_gangs"]:GetPlayerMemberGrade(src)| Prop | Description | Type |
|---|---|---|
| src | The source of the player to retrieve the gang member grade for. | number |
Returns: number - The grade of the player's gang member. |
Add Gang Cash
Adds cash to a gang's bank account.
exports["electus_gangs"]:AddGangCash(gangId, amount)| Prop | Description | Type |
|---|---|---|
| gangId | The ID of the gang to add cash to. | number |
| amount | The amount of cash to add to the gang's bank account. | number |
Remove Gang Cash
Removes cash from a gang's bank account.
exports["electus_gangs"]:RemoveGangCash(gangId, amount)| Prop | Description | Type |
|---|---|---|
| gangId | The ID of the gang to remove cash from. | number |
| amount | The amount of cash to remove from the gang's bank account. | number |
Add Gang Dirty Cash
Adds dirty cash to a gang's bank account.
exports["electus_gangs"]:AddGangDirtyCash(gangId, amount)| Prop | Description | Type |
|---|---|---|
| gangId | The ID of the gang to add dirty cash to. | number |
| amount | The amount of dirty cash to add to the gang's bank account. | number |
Remove Gang Dirty Cash
Removes dirty cash from a gang's bank account.
exports["electus_gangs"]:RemoveGangDirtyCash(gangId, amount)| Prop | Description | Type |
|---|---|---|
| gangId | The ID of the gang to remove dirty cash from. | number |
| amount | The amount of dirty cash to remove from the gang's bank account. | number |