Server Exports
GetPlayerGangData
Description
This function retrieves the gang data for a specified player, including the gang's details if the player belongs to a gang.
Usage
exports['ant-gangsystem']:GetPlayerGangData(playerid)
Parameters
- playerid: The ID of the player whose gang data is to be retrieved.
Returns
- Gang Data: An object containing details of the gang if the player is affiliated with one.
- "None": If the player does not belong to a gang.
- "Invalid Player ID": If the provided player ID does not correspond to a valid player.
- "No Player ID": If no player ID is provided.
Example
local gang_data = exports['ant-gangsystem']:GetPlayerGangData(1)
if gang_data then
print("Player's gang data: ", gang_data)
else
print("Player is not in a gang or invalid ID.")
end
This function is useful for obtaining a player's gang information for game mechanics, UI updates, or logging purposes.
IsPlayerCheckedIn
Description
This function checks if a specified player is currently checked into any faction.
Usage
exports['ant-gangsystem']:IsPlayerCheckedIn(player_id)
Parameters
- player_id: The ID of the player to check for faction status.
Returns
- true: If the player is checked into a faction.
- false: If the player is not checked into any faction.
Example
local is_checked_in = exports['ant-gangsystem']:IsPlayerCheckedIn(1)
if is_checked_in then
print("Player is checked into a faction.")
else
print("Player is not checked in.")
end
This function is beneficial for determining a player's participation in gang or faction activities.
GetGangPrevalence
Description
This function retrieves the prevalence of a player's gang, which indicates its influence or power level within the game.
Usage
exports['ant-gangsystem']:GetGangPrevalence(player_id)
Parameters
- player_id: The ID of the player whose gang prevalence is to be retrieved.
Returns
- prevalence: A number representing the gang's prevalence if the player belongs to a gang.
- nil: If the player does not belong to any gang.
Example
local prevalence = exports['ant-gangsystem']:GetGangPrevalence(1)
if prevalence then
print("Gang prevalence is: " .. prevalence)
else
print("Player does not belong to a gang.")
end
This function helps in tracking gang dynamics and making decisions based on the gang's influence.
IsGangAtWar
Description
This function checks whether a specified gang is currently at war.
Usage
exports['ant-gangsystem']:IsGangAtWar(gangID)
Parameters
- gangID: The identifier of the gang to check for war status.
Returns
- true: If the gang is at war.
- false: If the gang is not at war.
Example
local is_at_war = exports['ant-gangsystem']:IsGangAtWar(1)
if is_at_war then
print("The gang is currently at war.")
else
print("The gang is not at war.")
end
This function is great for determining gang relations and informing players about ongoing conflicts.
CustomPrevalenceIncrease
Description
This function allows for manual adjustment of a gang's prevalence, increasing it by a specified amount.
Usage
exports['ant-gangsystem']:CustomPrevalenceIncrease(gangID, amount)
Parameters
- gangID: The identifier of the gang whose prevalence is to be increased.
- amount: A number specifying how much to increase the gang's prevalence.
Returns
- nil: This function does not return a value.
Example
exports['ant-gangsystem']:CustomPrevalenceIncrease(1, 10)
print("Gang prevalence increased.")
This function is useful for game mechanics that require manual adjustments to gang strength, such as events or administrative actions.
CustomPrevalenceDecrease
Description
This function allows for manual adjustment of a gang's prevalence, decreasing it by a specified amount.
Usage
exports['ant-gangsystem']:CustomPrevalenceDecrease(gangID, amount)
Parameters
- gangID: The identifier of the gang whose prevalence is to be decreased.
- amount: A number specifying how much to decrease the gang's prevalence.
Returns
- nil: This function does not return a value.
Example
exports['ant-gangsystem']:CustomPrevalenceDecrease(1, 5)
print("Gang prevalence decreased.")
This function is beneficial for maintaining game balance and responding to player actions that may affect gang strength.