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.

  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:

AmIMemberOfThisContractById


This function checks if the player is a member of a contract based on the provided contract 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:

GetContractMembersById


This function retrieves the members associated with a specific contract 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:

GetContractResourceById


This function retrieves the resource associated with a specific contract 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:

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.

  1. id (number)

    • The contract ID to disable.

Usage Example:

Server

SetGang


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

  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:

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.

  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:

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.

  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:

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.

  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:

In this example:

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

RemoveGangMoney


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

  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:

In this example:

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

AddPoints


This function adds points to a specified gang.

  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:

In this example:

  • The gang "Ballas" is awarded 15 points.

RemovePoints


This function removes points from a specified gang.

  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:

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.

  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:

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.

  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:

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.

  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:

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.

  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:

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.

  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:

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.

  1. id (number)

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

Usage Example:

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.

Last updated