This section lists all available commands, exports, and events included in the script. You’ll find client-side, server-side, and shared functions designed to help developers integrate, extend, or interact with the system easily within their own scripts or frameworks.
Commands
This section lists all available commands included in the script. Each command is designed to simplify administration, player interaction, or debugging tasks. You’ll find detailed descriptions, usage examples, and permission requirements to help you manage and customize your server efficiently.
Command
Description
/setgang [id] [gang] [rank]
Administrative command to give gang to player.
/createdealer [name] [open ] [close]
Administrative command to create gang dealers, you need add open hour and close hour.
/removedealer [name]
Administrative command to remove gang dealer, example: Luis (you can check dealers in /dealers command)
/gotodealer [name]
Administrative command to go dealer position, example: Luis (you can check dealers in /dealers command)
/gang
Command to check your gang name and rank.
/dealerlist
Command to check dealer list.
/selldrugs
Command to start or stop sell drugs in your gang territory.
Client Exports
This section provides all available client exports for the script. These functions allow you to interact directly with the system from the client side, enabling custom features, UI interactions, and integrations with other resources. Each export includes a short description and usage example for easy implementation.
GetGang
The GetGang export allows you to retrieve the gang information of a player. This is particularly useful for implementing custom gang-related logic or features within your scripts.
How to Use
To get a player's gang information, use the following code:
local gang = exports['qs-gangs']:GetGang()if gang and gang.name ~='none' thenprint("The player belongs to a gang: " .. gang.name)elseprint("The player is not in any gang.")end
This export returns a table containing the gang's name and grade. You can use this data to check the player's gang affiliation or grade level and apply specific gameplay mechanics or restrictions accordingly.
GetGangLabel
The GetGangLabel export allows you to retrieve the label (display name) of the player's gang. This can be used to display the gang's name in UI elements, notifications, or custom scripts.
How to Use
To get the gang label, use the following code:
local gangLabel = exports['qs-gangs']:GetGangLabel()
if gangLabel then
print("The player's gang label is: " .. gangLabel)
else
print("The player is not in a gang.")
end
This export returns a string representing the label of the player's gang (e.g., "Ballas"). If the player is not part of a gang, it will return nil. Use this to dynamically adjust gang-related features or visuals in your scripts.
GetGangColor
The GetGangColor export allows you to retrieve the RGB color values associated with the player's gang. This is useful for customizing visuals, such as UI elements or in-game markers, to match the gang's color scheme.
How to Use
To get the RGB color of the player's gang, use the following code:
local gangColor = exports['qs-gangs']:GetGangColor()
if gangColor then
print("The gang color is: R:" .. gangColor.r .. " G:" .. gangColor.g .. " B:" .. gangColor.b)
else
print("The player is not in a gang.")
end
This export returns a table containing the RGB values (r, g, and b) of the gang's color. If the player is not part of a gang, it will return nil. Use this information to dynamically style elements related to the player's gang.
inDrag
The inDrag export allows you to check whether the player is currently dragging an injured player. This is particularly useful for restricting or modifying gameplay mechanics, such as disabling certain menus or actions while dragging.
How to Use
To check if the player is dragging an injured player, use the following code:
local isDragging = exports['qs-gangs']:inDrag()
if isDragging then
print("The player is dragging an injured person.")
else
print("The player is not dragging anyone.")
end
This export returns a boolean (true or false) indicating whether the player is actively dragging another character. Use this information to create custom logic that adapts based on the player's interaction state.
Server Exports
This section provides all available server exports for the script. These functions allow developers to interact with the system from the server side, manage data, trigger actions, and integrate with other resources. Each export includes a clear description and a practical example to simplify its implementation.
GetGangFromSource
The GetGangFromSource export allows you to retrieve the gang information of a player based on their source. This is useful for server-side scripts where you need to check or utilize gang-related data for a specific player.
How to Use
To get the gang information of a player by their source, use the following code:
local gangData = exports['qs-gangs']:GetGangFromSource(playerSource)
if gangData and gangData.name ~= 'none' then
print("The player is in the gang: " .. gangData.name)
else
print("The player is not part of any gang.")
end
This export returns an object containing the player's gang details, such as the gang name and grade. Use it in scripts where you need to manage or reference gang affiliations based on a specific player's source.
getGangs
The getGangs export allows you to retrieve a list of all gang IDs currently available in the system. This is particularly useful for syncing gang data with external systems or custom scripts.
How to Use
To fetch and process the list of gangs, use the following example:
function SyncGangSystem()
local gangs = exports['qs-gangs']:getGangs()
local data = {}
for name in pairs(gangs) do
table.insert(data, name)
end
initCustomGangs(data)
end
This export provides all gang IDs, which you can use to initialize custom systems, synchronize data, or apply custom logic in your scripts. The flexibility of this function allows you to adapt it to various use cases involving gang management.
setGang
The setGang export allows you to assign or remove a gang from a player by their ID. This is useful for dynamically managing gang membership within your server's systems.
How to Use
To assign a gang to a player:
function AddGangSystemMember(id, gangID)
local foundGang
for _, v in ipairs(Gangs) do
if v.id == gangID then
foundGang = v
break
end
end
if not foundGang then return end
local success, errorMessage = exports['qs-gangs']:setGang(id, foundGang.gangName)
if not success then
print('^1[^3ERROR^1] Failed to add gang to player: ' .. errorMessage)
end
end
To remove a gang from a player:
Copy
function RemoveGangSystemMember(id)
local success, errorMessage = exports['qs-gangs']:setGang(id, 'none')
if not success then
print('^1[^3ERROR^1] Failed to remove gang from player: ' .. errorMessage)
end
end
This export returns success and errorMessage to confirm whether the operation was successful or if there were issues, making it easy to debug or log actions when managing gang memberships.