⚙️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

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 (see timeAvailable 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:

  1. open and closed:

    • 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).

  2. influenceBar:

    • Enables or disables the influence bar in the UI.

    • Values:

      • true: Displays the influence bar.

      • false: Hides the influence bar.

  3. 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:

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:

  1. enable:

    • Enables or disables cooldown notifications.

    • Values:

      • true: Notifications are sent.

      • false: Notifications are disabled.

  2. notificationTarget:

    • Defines who receives the notifications.

    • Values:

      • 'onlyJob': Only players with jobs listed in Config.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:

  1. Config.BlipOnlyJob:

    • Defines who can see territory blips on the map.

    • Values:

      • true: Only players with jobs listed in Config.Jobs can see the blips.

      • false: All players on the server can see the blips.

  2. Config.DefaultZoneColor:

    • Defines the blip color on the map when the territory is not conquered by any gang.

    • Values:

  3. 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:

  1. enable:

    • Enables or disables the decay system.

    • Values:

      • true: Decay is active.

      • false: Decay is disabled.

  2. 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:

  1. name:

    • Unique name of the territory (used internally).

    • Example: 'bproof'.

  2. label:

    • Name displayed to players.

    • Example: 'Vest Craft'.

  3. 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 (using vector2).

    • blip: Settings for the map blip (center, rotation, width, and height).

  4. 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.

  5. 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:

  1. OwnedBy:

    • Text displayed to indicate which gang controls a territory.

    • Example: "Conquered by".

  2. Influence:

    • Text displayed to refer to a gang's influence in a territory.

    • Example: "Influence".

  3. 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