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:
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:
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.
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.
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
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.
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.
id
(number)The contract ID to disable.
Usage Example:
Server
SetGang
This function sets a player's gang affiliation and rank.
source
(number)The player executing the command. This is the source of the request.
identifier
(number)The in-game ID of the player whose gang affiliation is being set.
gang
(string)The name of the gang to assign to the target player.
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 ID23
to the gang"Vagos"
with the rank 2.
GetGang
This function retrieves the gang information for a specified player.
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.
source
(number)The player executing the command. This is the source of the request.
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 ID23
.
AddGangMoney
This function adds money to a specified gang's fund.
gang
(string)The name of the gang to which the money will be added.
amount
(number)The amount of money to add to the gang's account.
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 with5000
units of currency.
RemoveGangMoney
This function deducts money from a specified gang's fund.
gang
(string)The name of the gang from which the money will be deducted.
amount
(number)The amount of money to remove from the gang's fund.
details
(string)A text description or note to record under the transaction in the UI.
Usage Example:
In this example:
The gang
"Vagos"
has2000
units of currency deducted from its fund.
AddPoints
This function adds points to a specified gang.
gang
(string)The name of the gang to which the points will be added.
points
(number)The number of points to add to the gang's total.
Usage Example:
In this example:
The gang
"Ballas"
is awarded15
points.
RemovePoints
This function removes points from a specified gang.
gang
(string)The name of the gang from which the points will be deducted.
points
(number)The number of points to remove from the gang's total.
Usage Example:
In this example:
The gang
"Ballas"
has10
points deducted from its total.
SendNotification
This function sends a notification to a specified gang with optional location pinging.
title
(string)The title of the notification.
text
(string)The body text of the notification.
gang
(string)The name of the gang that will receive the notification.
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.
source
(number)The player (source) who is performing the action.
index
(number)The turf index, which is the turf ID retrieved from the database (SQL).
amount
(number)The number of trust points to add to the specified turf.
Usage Example:
In this example:
The player identified by
source
adds100
trust points to the turf with ID5
.
GetMyContractIdByResource
This function retrieves the contract ID for a player based on a specified resource.
source
(number)The player (source) whose contract ID is being requested.
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 bysource
and printed to the console.
GetContractResourceById
This function retrieves the resource associated with a specific contract ID.
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.
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 usingGetMyContractIdByResource
.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.
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