🔵
ZaT Scripts
  • Welcome
  • General information
  • 🟦QBCore
    • 🔵Amazon
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵Uber Eats
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵Foodie
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵Tap To Order
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵NoteBook
      • 💻Installation
      • ⚙️Configuration
    • 🔵Elevator
      • 💻Installation
      • ⚙️Configuration
    • 🔵Car Rental
      • 💻Installation
      • ⚙️Configuration
    • 🔵Crafting
      • 💻Installation
      • ⚙️Configuration
      • 📄Blueprints
      • 📄Reputations
      • ⚙️Others
    • 🔵Wash Money
      • 💻Installation
      • ⚙️Configuration
      • 💰More
    • 🔵Store Robbery
      • 💻Installation
      • ⚙️Configuration
    • 🔵Pacific Robbery
      • 💻Installation
      • ⚙️Configuration
    • 🔵Weed
      • 💻Installation
      • ⚙️Configuration
      • ⚙️Genetics
    • 🔵SnrBuns
      • 💻Installation
      • ⚙️Configuration
      • ⚙️Others
    • 🔵Mining PC
      • 💻Installation
      • ⚙️Configuration
      • ⚙️Others
      • 🛒Shops
    • 🔵Garbage Job
      • 💻Installation
      • ⚙️Configuration
      • ⁉️Common Questions
    • 🔵NPC Dialog
      • 💻Installation
      • ⚙️Configuration
      • 💡Reputations
    • 🔵Roof Running
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵Laundromat
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵SNR Restaurants
      • 💻Installation
      • ⚙️Configuration
      • ⁉️How To add a new restaurant
    • 🔵Farming & moonshine
      • 💻Installation
      • ⚙️Configuration
      • 🧑‍🔬Genetics
    • 🔵Art Heist
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵Maze Bank Heist
      • 💻Installation
      • ⚙️Configuration
    • 🔵Clothing Store Heist
      • 💻Installation
      • ⚙️Configuration
    • 🔵ATM Heist
      • 💻Installation
      • ⚙️Configuration
    • 🔵Cash Exchange Heist
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵MDT
      • 💻Installation
      • ⚙️Configuration
      • ⚠️Dispatch
      • 🕖Events
    • 🔵Gang
      • 💻Installation
      • Exports
      • ⚙️Configuration
      • 🚩Gang Creation
      • 📋Dashboard
      • Members
      • Contracts
      • Turfs
      • Transactions
      • Market
      • Wars
      • Leaderboard
      • Cameras
      • HQ +
    • 🔵GPS Tracker
      • 💻Installation
      • ⚙️Configuration
    • 🔵Pause Menu
      • 💻Installation
      • ⚙️Configuration
    • 🔵Perks
      • 💻Installation
      • ⚙️Configuration
      • Exports
      • ⁉️How To ?
    • 🔵Fleeca
      • 💻Installation
      • ⚙️Configuration
    • 🔵Whiteboard
      • 💻Installation
      • ⚙️Configuration
  • 🟦ESX
    • 🔵Amazon
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵Uber Eats
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵Foodie
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵Tap To Order
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵NoteBook
      • 💻Installation
      • ⚙️Configuration
    • 🔵Crafting
      • 💻Installation
      • ⚙️Configuration
      • 📄Blueprints
      • 📄Reputations
      • ⚙️Others
    • 🔵Elevator
      • 💻Installation
      • ⚙️Configuration
    • 🔵Car Rental
      • 💻Installation
      • ⚙️Configuration
    • 🔵Wash Money
      • 💻Installation
      • ⚙️Configuration
    • 🔵Store Robbery
      • 💻Installation
      • ⚙️Configuration
    • 🔵Pacific Robbery
      • 💻Installation
      • ⚙️Configuration
    • 🔵Weed
      • 💻Installation
      • ⚙️Configuration
      • ⚙️Genetics
    • 🔵SnrBuns
      • 💻Installation
      • ⚙️Configuration
      • ⚙️Others
    • 🔵Mining PC
      • 💻Installation
      • ⚙️Configuration
      • ⚙️Others
      • 🛒Shops
    • 🔵Garbage Job
      • 💻Installation
      • ⚙️Configuration
      • ⁉️Common Questions
    • 🔵NPC Dialog
      • 💻Installation
      • ⚙️Configuration
      • 💡Reputations
    • 🔵Roof Running
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵Laundromat
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵SNR Restaurants
      • 💻Installation
      • ⚙️Configuration
      • ⁉️How To add a new restaurant
    • 🔵Farming & moonshine
      • 💻Installation
      • ⚙️Configuration
      • 🧑‍🔬Genetics
    • 🔵Art Heist
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵Maze Bank Heist
      • 💻Installation
      • ⚙️Configuration
    • 🔵Clothing Store Heist
      • 💻Installation
      • ⚙️Configuration
    • 🔵ATM Heist
      • 💻Installation
      • ⚙️Configuration
    • 🔵Cash Exchange Heist
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵Gang
      • 💻Installation
      • Exports
      • ⚙️Configuration
      • 🚩Gang Creation
      • 📋Dashboard
      • Members
      • Contracts
      • Turfs
      • Transactions
      • Market
      • Wars
      • Leaderboard
      • Cameras
      • HQ +
    • 🔵GPS Tracker
      • 💻Installation
      • ⚙️Configuration
    • 🔵Pause Menu
      • 💻Installation
      • ⚙️Configuration
    • 🔵Perks
      • 💻Installation
      • ⚙️Configuration
      • Exports
      • ⁉️How To ?
    • 🔵Fleeca
      • 💻Installation
      • ⚙️Configuration
    • 🔵Whiteboard
      • 💻Installation
      • ⚙️Configuration
  • 🟦STANDALONE
    • 🔵Code Minigame
      • 💻Installation
      • ⚙️Usage
    • 🔵Menu and Task UI
      • 💻Installation
      • ⚙️Usage
      • ⁉️Common Questions
Powered by GitBook
On this page
  • Client
  • hideUI
  • hideCameraUI
  • GetMyContractIdByResource
  • AmIMemberOfThisContractById
  • GetContractMembersById
  • GetContractResourceById
  • DisableContractById
  • Server
  • SetGang
  • GetGang
  • RemoveGang
  • AddGangMoney
  • RemoveGangMoney
  • AddPoints
  • RemovePoints
  • SendNotification
  • AddTrust
  • GetMyContractIdByResource
  • GetContractResourceById
  • GetContractMembersById
  • DisableContractById
  1. QBCore
  2. Gang

Exports

All available client and server exports for use.

Client

hideUI


This function hides the gang-related user interface (UI) elements on the player's screen.

  • This function does not require any parameters.

Usage Example:

exports['zat-gangs']:hideUI()

In this example:

  • The gang UI elements are hidden from the player's screen.

hideCameraUI


This function hides the camera-related user interface (UI) elements from the player's screen.

  • This function does not require any parameters.

Usage Example:

exports['zat-gangs']:hideCameraUI()

In this example:

  • The camera UI elements are hidden from the player's screen.

GetMyContractIdByResource


This function retrieves the contract ID for the player based on the specified resource name.

exports['zat-gangs']:GetMyContractIdByResource(resource)
  1. resource (string)

    • The name of the resource for which the contract ID is being retrieved.

Returns:

  • contractId (number)

    • The contract ID associated with the specified resource.

Usage Example:

luaCopyEditlocal contractId = exports['zat-gangs']:GetMyContractIdByResource("zat-roofrunning")
print("Your contract ID is: " .. contractId)

AmIMemberOfThisContractById


This function checks if the player is a member of a contract based on the provided contract ID.

exports['zat-gangs']:AmIMemberOfThisContractById(id)
  1. id (number)

    • The contract ID to check membership for.

Returns:

  • boolean

    • Returns true if the player is a member of the contract, false otherwise.

Usage Example:

local contractId = exports['zat-gangs']:GetMyContractIdByResource("zat-roofrunning")
local isMember = exports['zat-gangs']:AmIMemberOfThisContractById(contractId)

if isMember then
    print("You are a member of this contract.")
else
    print("You are not a member of this contract.")
end

GetContractMembersById


This function retrieves the members associated with a specific contract ID

exports['zat-gangs']:GetContractMembersById(id)
  1. id (number)

    • The contract ID to retrieve the members for.

Returns:

  • members (table)

    • A table containing the IDs of members associated with the specified contract.

Usage Example:

luaCopyEditlocal contractId = exports['zat-gangs']:GetMyContractIdByResource("zat-roofrunning")
local contractMembers = exports['zat-gangs']:GetContractMembersById(contractId)

print(json.encode(contractMembers , {indent=true}))

GetContractResourceById


This function retrieves the resource associated with a specific contract ID.

exports['zat-gangs']:GetContractResourceById(id)
  1. id (number)

    • The contract ID to retrieve the associated resource for.

Returns:

  • resource (string)

    • The name of the resource associated with the given contract ID.

Usage Example:

luaCopyEditlocal contractId = 5  -- example contract ID
local contractResource = exports['zat-gangs']:GetContractResourceById(contractId)

print("Contract Resource: " .. contractResource)

DisableContractById


This client-side function disables a contract based on the provided contract ID. It is typically used after starting a contract or mission to prevent further abuse or changes.

exports['zat-gangs']:DisableContractById(id)
  1. id (number)

    • The contract ID to disable.

Usage Example:

luaCopyEditlocal contractId = exports['zat-gangs']:GetMyContractIdByResource("zat-roofrunning")
exports['zat-gangs']:DisableContractById(contractId)

Server

SetGang


This function sets a player's gang affiliation and rank.

exports['zat-gangs']:SetGang(source, identifier, gang, grade)
  1. source (number)

    • The player executing the command. This is the source of the request.

  2. identifier (number)

    • The in-game ID of the player whose gang affiliation is being set.

  3. gang (string)

    • The name of the gang to assign to the target player.

  4. grade (number)

    • The rank or grade within the gang to assign to the player.

Usage Example:

exports['zat-gangs']:SetGang(source, 23, "vagos", 2)

In this example:

  • The player identified by source assigns player with ID 23 to the gang "Vagos" with the rank 2.

GetGang


This function retrieves the gang information for a specified player.

exports['zat-gangs']:GetGang(source)
  1. source (number)

    • The player whose gang information is being requested.

Returns:

  • data (table)

    • A table containing the player's gang information:

      • data.gang (string): The name of the gang the player is affiliated with.

      • data.grade (number): The player's rank or grade within the gang.

Usage Example:

local data = exports['zat-gangs']:GetGang(source)
print("Gang Name: " .. data.gang)
print("Gang Grade: " .. data.grade)

In this example:

  • The player's gang name and grade are retrieved and printed to the console.

RemoveGang


This function removes a player's gang affiliation.

exports['zat-gangs']:RemoveGang(source, targetId)
  1. source (number)

    • The player executing the command. This is the source of the request.

  2. targetId (number)

    • The in-game ID of the player whose gang affiliation is to be removed.

Usage Example:

exports['zat-gangs']:RemoveGang(source, 23)

In this example:

  • The player identified by source removes the gang affiliation of the player with ID 23.

AddGangMoney


This function adds money to a specified gang's fund.

exports['zat-gangs']:AddGangMoney(gang, amount, details)
  1. gang (string)

    • The name of the gang to which the money will be added.

  2. amount (number)

    • The amount of money to add to the gang's account.

  3. details (string)

    • A text description or note to record under the transaction in the UI.

Usage Example:

exports['zat-gangs']:AddGangMoney("vagos", 5000, 'Gift from anonymous')

In this example:

  • The gang "Vagos" is credited with 5000 units of currency.

RemoveGangMoney


This function deducts money from a specified gang's fund.

exports['zat-gangs']:RemoveGangMoney(gang, amount, details)
  1. gang (string)

    • The name of the gang from which the money will be deducted.

  2. amount (number)

    • The amount of money to remove from the gang's fund.

  3. details (string)

    • A text description or note to record under the transaction in the UI.

Usage Example:

exports['zat-gangs']:RemoveGangMoney("vagos", 2000, 'bills payment')

In this example:

  • The gang "Vagos" has 2000 units of currency deducted from its fund.

AddPoints


This function adds points to a specified gang.

exports['zat-gangs']:AddPoints(gang, points)
  1. gang (string)

    • The name of the gang to which the points will be added.

  2. points (number)

    • The number of points to add to the gang's total.

Usage Example:

exports['zat-gangs']:AddPoints("ballas", 15)

In this example:

  • The gang "Ballas" is awarded 15 points.

RemovePoints


This function removes points from a specified gang.

exports['zat-gangs']:RemovePoints(gang, points)
  1. gang (string)

    • The name of the gang from which the points will be deducted.

  2. points (number)

    • The number of points to remove from the gang's total.

Usage Example:

exports['zat-gangs']:RemovePoints("ballas", 10)

In this example:

  • The gang "Ballas" has 10 points deducted from its total.

SendNotification


This function sends a notification to a specified gang with optional location pinging.

exports['zat-gangs']:SendNotification(title, text, gang, coords
  1. title (string)

    • The title of the notification.

  2. text (string)

    • The body text of the notification.

  3. gang (string)

    • The name of the gang that will receive the notification.

  4. coords (optional, vector3)

    • A vector3 representing the coordinates of a location. If provided, clicking the notification will show a location ping on the map. If not provided, no location ping will be shown.

Usage Example:

exports['zat-gangs']:SendNotification("Mission Update", "The Vagos have a new mission!", "vagos", vector3(215.5, -1350.3, 30.5))

In this example:

  • The "Vagos" gang receives a notification with the title "Mission Update" and the body text "The Vagos have a new mission!".

  • The notification also includes a clickable map location at the coordinates vector3(215.5, -1350.3, 30.5).

AddTrust


This function adds trust points to the player's gang's turf.

exports['zat-gangs']:AddTrust(src, index, amount)
  1. source(number)

    • The player (source) who is performing the action.

  2. index (number)

    • The turf index, which is the turf ID retrieved from the database (SQL).

  3. amount (number)

    • The number of trust points to add to the specified turf.

Usage Example:

exports['zat-gangs']:AddTrust(source, 5, 100)

In this example:

  • The player identified by source adds 100 trust points to the turf with ID 5.

GetMyContractIdByResource


This function retrieves the contract ID for a player based on a specified resource.

exports['zat-gangs']:GetMyContractIdByResource(source, resource)
  1. source (number)

    • The player (source) whose contract ID is being requested.

  2. resource (string)

    • The name of the resource to fetch the contract ID for. (script name)

Returns:

  • contractId (number)

    • The contract ID associated with the specified resource and player.

Usage Example:

local contractId = exports['zat-gangs']:GetMyContractIdByResource(source, "zat-roofrunning")
print("Contract ID: " .. contractId)

In this example:

  • The contract ID for the resource "zat-roofrunning" is retrieved for the player identified by source and printed to the console.

GetContractResourceById


This function retrieves the resource associated with a specific contract ID.

exports['zat-gangs']:GetContractResourceById(id)
  1. id (number)

    • The contract ID for which the resource is being retrieved.

Returns:

  • resource (string)

    • The name of the resource associated with the given contract ID.

Usage Example:

local contractResource = exports['zat-gangs']:GetContractResourceById(5)
print("Contract Resource: " .. contractResource)

In this example:

  • The contract ID for the "zat-roofrunning" resource is retrieved, and then the associated resource name is printed.

GetContractMembersById


This function retrieves the members associated with a specific contract ID.

exports['zat-gangs']:GetContractMembersById(id)
  1. id (number)

    • The contract ID for which the members are being retrieved. This can be obtained by using GetMyContractIdByResource(source, resource).

Returns:

  • members (table)

    • A table containing the list of members associated with the specified contract ID.

Usage Example:

local contractId = exports['zat-gangs']:GetMyContractIdByResource(source, "zat-roofrunning")
local contractMembers = exports['zat-gangs']:GetContractMembersById(contractId)
print(json.encode(contractMembers, {indent=true}))

In this example:

  • The contract ID for the "zat-roofrunning" resource is first retrieved using GetMyContractIdByResource.

  • Then, the list of members associated with that contract ID is printed.

DisableContractById


This function disables a contract using the specified contract ID, usually after a contract or mission has started to prevent abuse.

exports['zat-gangs']:DisableContractById(id)
  1. id (number)

    • The contract ID to be disabled. This ID can be obtained from functions like GetMyContractIdByResource(source, resource).

Usage Example:

luaCopyEditlocal contractId = exports['zat-gangs']:GetMyContractIdByResource(source, "zat-roofrunning")
exports['zat-gangs']:DisableContractById(contractId)

In this example:

  • The contract ID for the "zat-roofrunning" resource is retrieved and then the contract is disabled to prevent abuse after it has started.

PreviousInstallationNextConfiguration

Last updated 3 months ago

🟦
🔵