Exports & API
Core Gangs exposes exports for integration with other scripts.
Client Exports
client
exports['core_gangs']:getZoneFromPlayer()Returns the zone ID the player is currently standing in.
Returns:
numberExample
lua
local zoneId = exports['core_gangs']:getZoneFromPlayer()
print('Current zone:', zoneId)client
exports['core_gangs']:getZoneFromCoords(x, y)Returns the zone ID at the given map coordinates.
| Parameter | Type | Description |
|---|---|---|
x | number | X coordinate |
y | number | Y coordinate |
Returns:
numberExample
lua
local zoneId = exports['core_gangs']:getZoneFromCoords(732.12, -1088.83)
print('Zone at coords:', zoneId)client
exports['core_gangs']:getCoordsFromZone(zoneId)Returns the center coordinates of a zone.
| Parameter | Type | Description |
|---|---|---|
zoneId | number | The zone ID |
Returns:
number, numberExample
lua
local x, y = exports['core_gangs']:getCoordsFromZone(6740)client
exports['core_gangs']:getPlayerOrganization()Returns the name of the player's current organization, or nil if not in one.
Returns:
string | nilExample
lua
local org = exports['core_gangs']:getPlayerOrganization()
if org then
print('Player is in:', org)
endclient
exports['core_gangs']:isPlayerInZone(zoneId)Checks if the player is currently in the specified zone.
| Parameter | Type | Description |
|---|---|---|
zoneId | number | The zone ID to check |
Returns:
booleanExample
lua
if exports['core_gangs']:isPlayerInZone(6740) then
print('Player is in the weed zone')
endclient
exports['core_gangs']:isPlayerOrganizationZone(zoneId)Checks if the specified zone belongs to the player's organization.
| Parameter | Type | Description |
|---|---|---|
zoneId | number | The zone ID to check |
Returns:
booleanExample
lua
if exports['core_gangs']:isPlayerOrganizationZone(6740) then
print('This is our territory')
endclient
exports['core_gangs']:isOrganizationZone(orgName, zoneId)Checks if a zone belongs to a specific organization.
| Parameter | Type | Description |
|---|---|---|
orgName | string | Organization name |
zoneId | number | The zone ID to check |
Returns:
booleanExample
lua
if exports['core_gangs']:isOrganizationZone('ballas', 7067) then
print('Ballas own this zone')
endclient
exports['core_gangs']:inWarZone()Checks if the player is currently in an active war zone.
Returns:
booleanExample
lua
if exports['core_gangs']:inWarZone() then
print('War is active here!')
endServer Exports
server
exports['core_gangs']:getOrganization(identifier)Returns the organization name of a player by their identifier or server ID.
| Parameter | Type | Description |
|---|---|---|
identifier | string | number | Player identifier (citizenid) or server ID |
Returns:
string | nilExample
lua
local org = exports['core_gangs']:getOrganization(source)
if org then
print('Player org:', org)
endserver
exports['core_gangs']:getZoneOrganization(zoneId)Returns the organization name that owns a zone, or nil if unowned.
| Parameter | Type | Description |
|---|---|---|
zoneId | number | The zone ID |
Returns:
string | nilExample
lua
local owner = exports['core_gangs']:getZoneOrganization(6740)server
exports['core_gangs']:getOrganizationZones(orgName)Returns a table of zone IDs owned by the specified organization.
| Parameter | Type | Description |
|---|---|---|
orgName | string | Organization name |
Returns:
table | nilExample
lua
local zones = exports['core_gangs']:getOrganizationZones('vagos')
if zones then
for _, zoneId in ipairs(zones) do
print('Zone:', zoneId)
end
endserver
exports['core_gangs']:isOrganizationZone(orgName, zoneId)Checks if a zone belongs to a specific organization.
| Parameter | Type | Description |
|---|---|---|
orgName | string | Organization name |
zoneId | number | The zone ID |
Returns:
booleanExample
lua
if exports['core_gangs']:isOrganizationZone('ballas', 7067) then
print('Ballas own this zone')
endserver
exports['core_gangs']:isPlayerOrganizationZone(identifier, zoneId)Checks if a zone belongs to the player's organization.
| Parameter | Type | Description |
|---|---|---|
identifier | string | Player identifier (citizenid) |
zoneId | number | The zone ID |
Returns:
booleanExample
lua
local identifier = 'ABC12345'
if exports['core_gangs']:isPlayerOrganizationZone(identifier, 6740) then
print('This zone belongs to the player\\'s org')
endserver
exports['core_gangs']:isWarInProgress(zoneId)Checks if a war is currently active in the specified zone.
| Parameter | Type | Description |
|---|---|---|
zoneId | number | The zone ID |
Returns:
booleanExample
lua
if exports['core_gangs']:isWarInProgress(6740) then
print('War is active in zone 6740')
endserver
exports['core_gangs']:createOrganization(playerSource, orgName, colorHex, source)Creates a new organization. The player becomes the owner.
| Parameter | Type | Description |
|---|---|---|
playerSource | number | string | Player server ID or identifier |
orgName | string | Organization name |
colorHex | string | Hex color (e.g. #FF0000) |
source | number | Admin source (optional) |
Example
lua
exports['core_gangs']:createOrganization(source, 'NewGang', '#FF5500')server
exports['core_gangs']:deleteOrganization(orgName, source)Deletes an organization and removes all members from it.
| Parameter | Type | Description |
|---|---|---|
orgName | string | Organization name to delete |
source | number | Admin source (optional) |
Example
lua
exports['core_gangs']:deleteOrganization('OldGang')server
exports['core_gangs']:setPlayerToOrg(source, orgName)Adds a player to an organization.
| Parameter | Type | Description |
|---|---|---|
source | number | Player server ID |
orgName | string | Organization name |
Example
lua
exports['core_gangs']:setPlayerToOrg(source, 'vagos')server
exports['core_gangs']:setPlayerAsOrgOwner(source, orgName)Sets a player as the owner of an organization.
| Parameter | Type | Description |
|---|---|---|
source | number | Player server ID |
orgName | string | Organization name |
Example
lua
exports['core_gangs']:setPlayerAsOrgOwner(source, 'vagos')server
exports['core_gangs']:removePlayerFromOrganization(identifier)Removes a player from their organization by identifier.
| Parameter | Type | Description |
|---|---|---|
identifier | string | Player identifier (citizenid) |
Example
lua
exports['core_gangs']:removePlayerFromOrganization('ABC12345')server
exports['core_gangs']:setZoneToOrg(zoneId, orgName)Assigns a zone to an organization without war.
| Parameter | Type | Description |
|---|---|---|
zoneId | number | The zone ID |
orgName | string | Organization name |
Example
lua
exports['core_gangs']:setZoneToOrg(7067, 'ballas')server
exports['core_gangs']:removeZoneOwner(zoneId)Removes ownership from a zone, making it neutral.
| Parameter | Type | Description |
|---|---|---|
zoneId | number | The zone ID |
Example
lua
exports['core_gangs']:removeZoneOwner(7067)server
exports['core_gangs']:startWar(zoneId)Programmatically starts a war in the specified zone.
| Parameter | Type | Description |
|---|---|---|
zoneId | number | The zone ID to start war in |
Example
lua
exports['core_gangs']:startWar(6740)Refresh Exports
Force refresh data on all connected clients:
server
exports['core_gangs']:refreshOrganizationOnAllClient()Refreshes organization data on all connected clients.
Example
lua
exports['core_gangs']:refreshOrganizationOnAllClient()server
exports['core_gangs']:refreshZoneOnAllClient()Refreshes zone data on all connected clients.
Example
lua
exports['core_gangs']:refreshZoneOnAllClient()server
exports['core_gangs']:refreshCriminalOnAllClient()Refreshes criminal profile data on all connected clients.
Example
lua
exports['core_gangs']:refreshCriminalOnAllClient()server
exports['core_gangs']:refreshBountyOnAllClient()Refreshes bounty data on all connected clients.
Example
lua
exports['core_gangs']:refreshBountyOnAllClient()