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

Client

ClientSide exports of the territories script.


Use these exports at your own risk. Please note that improper use may result in performance or stability issues. Implementing them in fast loops or modifying the script name is not recommended for proper functionality.

The client-side exports will not modify anything in the script, they will only return information for obvious security reasons.

IsMyZone

---@param territory string
---@return boolean
exports["cs-territories"]:isMyZone(territory)
exports["cs-territories"]:isMyZone()

Returns a true boolean if the organization to which it belongs has the maximum influence in that territory. If the string is left empty, it will be done with the territory in which it is located.


GetCurrent

---@return string
exports["cs-territories"]:GetCurrent()

It will return the name of the territory you are in. If you are not in any territory, it will return a false boolean.


GetMaxInfluence

---@param territory string
---@return array
exports["cs-territories"]:GetMaxInfluence(territory)

It will return a table with the appearance of the table below. If the territory is not specified, it will use the territory in which the user is located.

array = {
    ["name"] = (string or false),
    ["value"] = (int or 0)
}

You can use the "json.encode()" function to encode as string the content.


GetInfluences

---@param territory string
---@return array
exports["cs-territories"]:GetInfluences(territory)

It will return a table with the territory influences; it might be an empty table if there is no data. If a territory is not specified, the current territory will be assigned.


GetTerritories

---@return array
exports["cs-territories"]:GetTerritories()

It will return a table with all the territories information.


GetPodium

---@param territory string
---@return array
exports["cs-territories"]:GetPodium(territory)

It will return a table with the content of the conquest podium displayed in the interface. It will contain information such as the numeric value or the gang name. Similar to the HTML podium, it will only return the top three bands with the most influence, following their respective order.


GetGangInfluence

---@param gang string
---@param territorie string
---@return integer
exports["cs-territories"]:GetGangInfluence(gang, territorie)

Both fields will be mandatory. it will return the influence of a band in a specific territory.

Last updated 1 year ago

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