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 - true if in pause period, false otherwise

Example:

local inPause = exports['mad-crime-app']:IsCompetitionInPausePeriod()
if inPause then
    print("Competition is in pause period")
end

GetFactionId

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, or nil if 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: Returns true on success, false on 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 ID

  • xpAmount (number) - The amount of XP to add

  • citizenid (string, optional) - The citizenid of the player who earned the XP (for buff calculation)

Returns:

  • boolean - true on success, false on failure

  • boolean - true if faction leveled up, false otherwise

  • number - 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 name

  • groupID (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