Territories
This script features a territory control system that uses points to determine which gang dominates a specific area. It uses GTA native zones; custom zones (or polyzones) are not supported. Points are gained or lost through various in-game events, you also have client exports you can trigger from your own scripts.

Territory Colors
Gangs can set their own territory color in Settings tab > Gang Color, this option will also change the UI color to match their gang style.

Exports
getZone()
Retrieves the gang that controls the zone where player is standing.
returns
result:
string | falseGang name or false if the zone isn't controlled by any ganglocal controlled = exports['av_gangs']:getZone() print(controlled)
myZone()
Returns true if the current zone is controlled by the player gang or false.
returns
result:
booleanlocal myZone = exports['av_gangs']:myZone() print(myZone)
addZoneXP(amount)
Add the desired points to the zone where the player is standing.
params:
amount:
numberAmount of points to add to zone.local toAdd = 10 exports['av_gangs']:addZoneXP(toAdd) -- will add 10 points to current zone
removeZoneXP(amount)
Remove points to the zone where the player is standing.
params:
amount:
numberAmount of points to remove from zonelocal toRemove = 5 exports['av_gangs']:removeZoneXP(toRemove) -- will remove 5 points to zone
addZonePoints(gang,zone,amount)
Add points for a gang to a specific zone.
params:
gang:
stringGang namezone:
stringZone nameamount:
numberAmount of points to add to territoryreturns
result:
booleanlocal gang = 'lossantosvagos' local zone = 'DAVIS' local amount = 10 local added = exports['av_gangs']:addZonePoints(gang,zone,amount) print('added?', added)
removeZonePoints(gang,zone,amount)
Remove gang points from a territory.
params:
gang:
stringGang namezone:
stringZone nameamount:
numberAmount of points to removereturns:
result:
booleanlocal gang = "lossantosvagos" local zone = "DAVIS" local amount = 5 local removed = exports['av_gangs']:removeZonePoints(gang,zone,amount) print('removed?', removed)
getZoneGang(zone)
Returns the gang with the most points in the zone.
params:
zone:
stringZone namereturns:
gang:
null | stringReturns the gang name or null if zone does not exist or zone isn't controlled by anyone.local zone = "VINE" local topGang = exports['av_gangs']:getZoneGang(zone) print('topGang?', topGang)
Last updated