exports (server)
Faction Exports
IsCompetitionInPausePeriod
Checks if the competition is currently in a pause period (between ending and restart).
Location: server/main.lua
Parameters:
None
Returns:
boolean-trueif in pause period,falseotherwise
Example:
local inPause = exports['mad-crime-app']:IsCompetitionInPausePeriod()
if inPause then
print("Competition is in pause period")
endGetFactionId
Gets the faction ID for a player based on their citizenid.
Location: server/main.lua
Parameters:
citizenid(string): The citizen ID of the player.
Returns:
string|nil: The faction ID if the player belongs to a faction, ornilif they don't belong to any faction.
Example:
AddFactionReputation
Adds reputation to a faction, with automatic zone radius updates and competition pause period checks.
Location: server/main.lua
Parameters:
factionId(string): The faction ID to add reputation to.amount(number): The amount of reputation to add (can be negative to remove reputation).
Returns:
boolean: Returnstrueon success,falseon failure (faction not found, competition in pause period, or invalid parameters).
Example:
AddFactionXP
Adds XP to a faction, with automatic level-up handling and territory buffs.
Location: server/main.lua
Parameters:
factionId(number) - The faction IDxpAmount(number) - The amount of XP to addcitizenid(string, optional) - The citizenid of the player who earned the XP (for buff calculation)
Returns:
boolean-trueon success,falseon failureboolean-trueif faction leveled up,falseotherwisenumber- The new faction level
Example:
Territory Exports
GetPlayerTerritoryBuffs
Gets all territory buffs for a player based on their faction's controlled territories.
Location: server/territories.lua
Parameters:
source(number) - The player's server ID
Returns:
table- Table with buff types as keys and values as numbers
Example:
Delivery Race Exports
SetDeliveryRaceWaiting
Sets a delivery race team as waiting.
Location: server/delivery_race_server.lua
Parameters:
teamName(string) - The team namegroupID(number) - The group ID
Returns:
void
Example:
ClearDeliveryRaceWaiting
Clears the waiting state for delivery race.
Location: server/delivery_race_server.lua
Parameters:
None
Returns:
void
Example:
Last updated