Exports
Integrate Electus Gangs to your scripts
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. |