Cosmos Studios Docs
Discord
  • πŸ””Welcome to Cosmos Studios Docs!
  • πŸ‘¨β€πŸ’»Scripts
    • πŸ—ΊοΈTerritories
      • 🎨Features
      • πŸ“šInstallation
      • ⌨️Commands
      • βš™οΈConfiguration
      • πŸ€™Exports
        • Client
        • Server
Powered by GitBook
On this page
  1. Scripts
  2. Territories

Configuration

Default configuration file

config.lua
--[[
    [!] - Config logs webhooks on \server\custom.lua
]]

Config = {}
Locales = {}
Territories = {}
Territories.Functions = {}

Config.Framework = "ESX" -- "QBCore" or "ESX" (case sensitive)
Config.DBConnector = "oxmysql" -- "oxmysql" or "icmysql" (Only for ESX version)
Config.Locales = "es" -- Set script language. You can see the available languages in \locales\*.lua
Config.DBautosave = 300000 -- In ms (5 minutes)

Config.CanHidePannel = true -- (By default, "F4" to alter visibility, command: "+AltTerritoriesVis")
Config.HideMapColors = true -- Hide map colors while the pannel is disabled.
Config.HidePannelKey = "F4" -- If false, is disabled keybind
Config.HidePannelCommand = "+AltTerritoriesVis"
Config.PannelDefaultShowing = true
Config.HideCommandSuggestion = false

Config.UsingRcoreSpray = false -- This script is preconfigured with RCore Spray, but if you're using another script, you can implement it by reading the script documentation. 

--[[
    Edit spray options on \server\custom.lua
    Documentation: https://cosmos-studios.gitbook.io/documentation/scripts/territories
]]

Config.EnableCornerselling = true
Config.MaxDrugSell = 5 -- The maximum amount of drugs the NPC will buy per sale.
Config.SellDrugsDowngrade = 0.5 -- Percentage decrease/increase when selling drugs.
Config.PriceBoost = 20 -- By having the maximum level of influence, the sales price will increase by this value.
Config.SellDrugsCommand = "selldrugs"
Config.SellingProgressbar = true
Config.PoliceRequired = 1 -- Required police to sell drugs. (Set false to disable checking)
Config.Policejobs = {
    "police",
    "sheriff"
}
Config.SellAnim = {
    ["enable"] = true, -- Enable selling script anim?
    ["dictionary"] = "amb@prop_human_bum_bin@idle_b",
    ["name"] = "idle_d"
}

Config.EnableInactivityDowngrade = true -- While having this option active, the inactive gangs will lose influency on territories.
Config.DowngradeTime = 600000 -- In miliseconds. (Default: 10 minutes)
Config.InactivityDowngrade = 0.3 -- When no gang member is in the territory, the influence will drop below the value specified here.

Config.EnableDeadBoost = true -- When a player from one gang kills a player from another gang by shooting, value will be added to the one who did the killing and subtracted from the one who died.
Config.PlayerDeath = 10 -- Value death in territory.

Config.Sales = { -- Max value = 100, Min value = 0.
  ["buyChance"] = 90,  -- Chance to sell NPC's drug.
  ["reportChance"] = 30 -- Chance to alert the Police.
}

Config.DrugPrices = { -- Random or fixed price!
  ["weed"] = 70,
  ["cocaine"] = math.random(90, 120),
  ["meth"] = 140
}

Config.dispatcherAlerts = { -- Random alerts for the police when selling drugs.
  "Hello, police! I was just approached by someone trying to sell me drugs. We need help here, please!",
  "Emergency! Someone just tried to sell me drugs. I don't know what to do, but please, send someone quickly.",
  "Help! Someone tried to sell me something illegal. I need immediate police assistance, there could be more people involved!",
  "Police, please come quickly! I was just harassed by someone trying to force me to buy drugs. It's urgent, they could continue approaching more people!",
  "Please, send help! There was an attempted drug sale. I don't feel safe, we need the police here right away."
}

Config.Colors = {
---------------------------------|
  ["none"] = 2, -- Do not touch! |
---------------------------------|
  ["families"] = 69,
  ["ballas"] = 27,
  ["vagos"] = 46
}

Config.Territories = {
  ["city_1"] = {
    ["location"] = vector3(-1833.93, -441.79, 43.95),
    ["width"] = 818.0,
    ["height"] = 630.0,
    ["rotation"] = 50,
    ["allowlist"] = { -- Enable drug allowlist in the territory?
      ["weed"] = true
    }
  },
  ["city_2"] = {
    ["location"] = vector3(-1566.32, -907.17, 18.3),
    ["width"] = 190.0,
    ["height"] = 998.0,
    ["rotation"] = 50
  },
  ["city_3"] = {
    ["location"] = vector3(-1147.81, -264.03, 37.89),
    ["width"] = 900.0,
    ["height"] = 524.0,
    ["rotation"] = 50
  },
  ["city_4"] = {
    ["location"] = vector3(-1199.11, -1144.1, 14.36),
    ["width"] = 677.0,
    ["height"] = 524.0,
    ["rotation"] = 50
  },
  ["city_5"] = {
    ["location"] = vector3(-1420.98, -1534.68, 2.07),
    ["width"] = 839.0,
    ["height"] = 360.1,
    ["rotation"] = 50
  },
  ["city_6"] = {
    ["location"] = vector3(-768.54, -1502.72, 3.51),
    ["width"] = 443.0,
    ["height"] = 526.1,
    ["rotation"] = 50
  },
  ["city_7"] = {
    ["location"] = vector3(-801.78, -1014.91, 13.35),
    ["width"] = 1120.0,
    ["height"] = 183.1,
    ["rotation"] = 50
  },
  ["city_8"] = {
    ["location"] = vector3(-533.07, -693.4, 33.24),
    ["width"] = 594.0,
    ["height"] = 656.1,
    ["rotation"] = 50
  },
  ["city_9"] = {
    ["location"] = vector3(-1075.15, -2393.27, 13.95),
    ["width"] = 794.0,
    ["height"] = 1231.1,
    ["rotation"] = 50
  },
  ["city_10"] = {
    ["location"] = vector3(-467.14, -1634.89, 39.08),
    ["width"] = 189.0,
    ["height"] = 711.0,
    ["rotation"] = 50
  },
  ["city_11"] = {
    ["location"] = vector3(-72.36, -1563.82, 31.31),
    ["width"] = 325.0,
    ["height"] = 711.0,
    ["rotation"] = 50
  },
  ["city_12"] = {
    ["location"] = vector3(41.46, -1884.91, 22.23),
    ["width"] = 260.3,
    ["height"] = 364.2,
    ["rotation"] = 50
  },
  ["city_13"] = {
    ["location"] = vector3(269.17, -1612.74, 31.97),
    ["width"] = 260.3,
    ["height"] = 347.2,
    ["rotation"] = 50
  },
  ["city_14"] = {
    ["location"] = vector3(372.52, -1937.69, 24.62),
    ["width"] = 316.2,
    ["height"] = 710.2,
    ["rotation"] = 50
  },
  ["city_15"] = {
    ["location"] = vector3(-179.43, -2140.2, 20.94),
    ["width"] = 900.0,
    ["height"] = 310.0,
    ["rotation"] = 50
  },
  ["city_16"] = {
    ["location"] = vector3(-63.73, -948.36, 29.35),
    ["width"] = 453.0,
    ["height"] = 868.0,
    ["rotation"] = 50
  },
  ["city_17"] = {
    ["location"] = vector3(725.6, -2434.44, 20.02),
    ["width"] = 864.0,
    ["height"] = 1018.0,
    ["rotation"] = 50
  },
  ["city_18"] = {
    ["location"] = vector3(563.12, -1226.94, 42.28),
    ["width"] = 866.0,
    ["height"] = 622.0,
    ["rotation"] = 50
  },
  ["city_19"] = {
    ["location"] = vector3(1225.12, -1782.41, 41.81),
    ["width"] = 866.0,
    ["height"] = 622.0,
    ["rotation"] = 50
  },
  ["city_20"] = {
    ["location"] = vector3(1071.96, -579.24, 56.75),
    ["width"] = 813.0,
    ["height"] = 1025.0,
    ["rotation"] = 50
  },
  ["city_21"] = {
    ["location"] = vector3(-690.95, 279.57, 82.59),
    ["width"] = 898.5,
    ["height"] = 896.8,
    ["rotation"] = 50
  },
  ["city_22"] = {
    ["location"] = vector3(0.04, -56.68, 63.29),
    ["width"] = 593.5,
    ["height"] = 1003.8,
    ["rotation"] = 50
  },
  ["city_23"] = {
    ["location"] = vector3(468.65, -313.36, 47.15),
    ["width"] = 453.5,
    ["height"] = 788.8,
    ["rotation"] = 50
  },
  ["city_24"] = {
    ["location"] = vector3(576.24, 236.59, 103.12),
    ["width"] = 996.5,
    ["height"] = 189.0,
    ["rotation"] = 50
  },

  -- North

  ["sandy_1"] = {
    ["location"] = vector3(937.83, 2684.58, 40.47),
    ["width"] = 500.5,
    ["height"] = 1289.0,
    ["rotation"] = 0
  },
  ["sandy_2"] = {
    ["location"] = vector3(1710.79, 3742.96, 33.79),
    ["width"] = 500.5,
    ["height"] = 1289.0,
    ["rotation"] = 30
  },

  ["paleto_1"] = {
    ["location"] = vector3(-166.24, 6391.02, 35.65),
    ["width"] = 500.5,
    ["height"] = 1289.0,
    ["rotation"] = 40
  },
}

-- Framework stuff --

if (Config.Framework == "QBCore") then
  Core = exports["qb-core"]:GetCoreObject()
elseif (Config.Framework == "ESX") then
  Core = exports['es_extended']:getSharedObject()
else
  print('^1[ERROR] No valid framework has been declared in "Config.Framework". Please specify the value in QBCore or ESX.^7')
end

-- Framework stuff --

Last updated 1 year ago

πŸ‘¨β€πŸ’»
πŸ—ΊοΈ
βš™οΈ