⚙️Script Configuration
Adjustments guide for mg-territories
Framework Configuration
You can choose between oldesx, newesx, newqb, oldqb and autodetect in config file.
Config.Framework = 'newqb' -- oldesx, newesx, newqb, oldqb or autodetect
Some parts of the script may not work at 100% when you choose "autodetect" I strongly recommned to only set autodetect to find what framework you are using in case you are not sure, after that select the exact one you are using.
Database Configuration
Config.SQL = "oxmysql" -- oxmysql | -- ghmattimysql | -- mysql-async
Timed Conquests Configuration
This setting determines whether territory conquests are restricted to specific times or can happen at any moment.
Possible Values:
true
: Gangs can only conquer territories during the designated times set for each zone (seetimeAvailable
in territory configurations).false
: Gangs can conquer territories at any time, ignoring time restrictions.
Config.TimedConquest = true -- true | false
Setting Up the UI
This configuration controls the behavior and appearance of the user interface (UI) that displays gang influence in territories.

Parameters:
open
andclosed
:Defines the position of the UI on the screen when it is visible or hidden.
Format:
{ x = "X%", y = "Y%" }
(coordinates as a percentage of the screen).
influenceBar
:Enables or disables the influence bar in the UI.
Values:
true
: Displays the influence bar.false
: Hides the influence bar.
barColors
:Defines the colors of the influence bar based on the gang controlling the territory.
Format:
default
: Color of the bar when the territory is unclaimed.[gang]
: Color of the bar when the territory is controlled by a specific gang.
Colors:
Use HEX codes, RGB, or RGBa (e.g.,
#4CAF50
,rgb(255, 0, 0)
).Useful Tool: W3Schools Color Picker.
Setting Up The Minimum Players in a Spot
This setting defines the minimum number of players from the same or job that must be inside a territory for influence to start increasing.
Config.MinGain = 1
Multiplier Configuration
When enabled, the influence gained per tick is multiplied by the number of players from the same job inside the territory. This allows zones to be captured faster when more teammates are present.
Config.InfluenceMultiplier = true
Update Interval Configuration
This setting defines the time interval (in milliseconds) required for a gang's influence to increase by 1% in a territory and the time interval (in milliseconds) between updates of the user interface displaying influence.
Config.PercentageInterval = 5000 -- time in ms for each 1%
Config.UiUpdateInterval = 5000 -- time in ms for the interval on updating the UI
Cooldown System Configuration
This setting defines the cooldown time (in minutes) after a territory is conquered, during which no gang can gain influence in the zone and controls the notifications sent to players when a territory enters cooldown.

Possible Values for Config.ZoneCooldown
:
Integer (in minutes).
false
: Disables the cooldown system.
Parameters for Config.CooldownNotify
:
enable
:Enables or disables cooldown notifications.
Values:
true
: Notifications are sent.false
: Notifications are disabled.
notificationTarget
:Defines who receives the notifications.
Values:
'onlyJob'
: Only players with jobs listed inConfig.Jobs
receive notifications.'all'
: All players on the server receive notifications.
Zone Warning Configuration
This setting defines whether territory owners (players with the corresponding job) will be warned when someone is invading their zone.

Blip Configuration
This configuration block controls the visibility of territory blips on the map and the colors associated with each job.

Parameters:
Config.BlipOnlyJob
:Defines who can see territory blips on the map.
Values:
true
: Only players with jobs listed inConfig.Jobs
can see the blips.false
: All players on the server can see the blips.
Config.DefaultZoneColor
:Defines the blip color on the map when the territory is not conquered by any gang.
Values:
Use color codes from the FiveM documentation.
Example:
0
(default color, white).
Config.Jobs
:List of jobs that can conquer territories, with their corresponding blip colors.
Decay Configuration
This configuration controls the influence decay system, where a gang's influence in a territory decreases over time if no gang members are present.

Parameters:
enable
:Enables or disables the decay system.
Values:
true
: Decay is active.false
: Decay is disabled.
time
:Defines the time in minutes required for influence to decrease by 1% if no members of the owning gang are in the territory.
Values:
Integer (in minutes).
Territory Configuration
This block defines all the territories that can be conquered on the server. Each territory has a unique name, an area defined by coordinates, and specific settings like gang access, conquest times, and map appearance.

Structure of a Territory:
name
:Unique name of the territory (used internally).
Example:
'bproof'
.
label
:Name displayed to players.
Example:
'Vest Craft'
.
mapping
:Defines the area of the territory on the map.
center
: Coordinates of the zone's center (used for internal calculations).points
: List of vertices forming the Polyzone (usingvector2
).blip
: Settings for the map blip (center, rotation, width, and height).
jobAccess
:Defines which jobs can conquer the territory.
Values:
'all'
: All gangs can conquer.{'mafia', 'cartel'}
: Only the listed gangs.'mafia'
: Only a specific gang.
timeAvailable
:Defines when the territory can be conquered (used only if
Config.TimedConquest = true
).Values:
'anytime'
: Always available.Custom structure:
timeAvailable = { day = 'Monday', -- Day of the week (or `false` for any day). hour = 20, -- Start hour. minutes = 30, -- Start minutes. availableFor = 15 -- Duration in minutes. }
Language Configuration
This block defines the translations or localized texts used in the script. It allows you to customize the messages displayed to players, such as the names of the days of the week or specific terms related to the territory system.

Parameters:
OwnedBy
:Text displayed to indicate which gang controls a territory.
Example:
"Conquered by"
.
Influence
:Text displayed to refer to a gang's influence in a territory.
Example:
"Influence"
.
Days of the Week:
Translations for the names of the days of the week (used in notifications or interfaces).
Notification Configuration
This block defines the notification messages displayed to players during specific events.

Last updated