Server
Crypto Exports
AddCryptoToPlayer
AddCryptoToPlayerAdds cryptocurrency to a player's balance.
Location: server/crypto.lua
Parameters:
citizenid(string) - The citizenid of the playercryptoCode(string) - The crypto code (SCRPT, GG, RACE)amount(number) - The amount to add
Returns:
number|nil- The new balance, ornilif invalid parameters
Example:
local newBalance = exports['mad-crimetablet']:AddCryptoToPlayer('ABC12345', 'SCRPT', 100)
if newBalance then
print("New balance: " .. newBalance)
endRemoveCryptoFromPlayer
RemoveCryptoFromPlayerRemoves cryptocurrency from a player's balance.
Location: server/crypto.lua
Parameters:
citizenid(string) - The citizenid of the playercryptoCode(string) - The crypto code (SCRPT, GG, RACE)amount(number) - The amount to remove
Returns:
boolean-trueon success,falseon failure
Example:
GetPlayerCryptoBalance
GetPlayerCryptoBalanceGets a player's cryptocurrency balance.
Location: server/crypto.lua
Parameters:
citizenid(string) - The citizenid of the playercryptoCode(string) - The crypto code (SCRPT, GG, RACE)
Returns:
number- The balance (returns0.0if not found or invalid)
Example:
Services Exports
IsServiceInCooldown
IsServiceInCooldownChecks if a service is currently in cooldown.
Location: server/services.lua
Parameters:
serviceType(string) - The service type identifier
Returns:
boolean-trueif in cooldown,falseotherwisenumber- Remaining time in seconds (0 if not in cooldown)
Example:
StartServiceCooldown
StartServiceCooldownStarts a cooldown period for a service.
Location: server/services.lua
Parameters:
serviceType(string) - The service type identifier
Returns:
boolean-trueon success,falseif service doesn't exist
Example:
ClearServiceCooldown
ClearServiceCooldownManually clears a service cooldown (typically for admin use).
Location: server/services.lua
Parameters:
serviceType(string) - The service type identifier
Returns:
boolean-trueon success,falseif service doesn't exist
Example:
FormatTimeRemaining
FormatTimeRemainingFormats remaining time in a human-readable format.
Location: server/services.lua
Parameters:
seconds(number) - Time in seconds to format
Returns:
string- Formatted time (e.g., "2h 30m", "45m 30s", "30s")
Example:
PayForService
PayForServiceProcesses payment for a service.
Location: server/services.lua
Parameters:
source(number) - The player's server IDserviceType(string) - The service type identifier
Returns:
boolean-trueif payment was successful,falseotherwise
Example:
IsGroupInMission
IsGroupInMissionChecks if a group is currently in an active mission.
Location: server/services.lua
Parameters:
groupID(number) - The group ID to check
Returns:
boolean-trueif group has active mission,falseotherwisestring|nil- The service type if in mission,nilotherwise
Example:
RegisterGroupMission
RegisterGroupMissionRegisters an active mission for a group.
Location: server/services.lua
Parameters:
groupID(number) - The group IDserviceType(string) - The service type identifiermissionData(table, optional) - Additional mission data
Returns:
boolean-trueon success,falseif group already has active mission
Example:
UnregisterGroupMission
UnregisterGroupMissionRemoves an active mission registration for a group.
Location: server/services.lua
Parameters:
groupID(number) - The group ID
Returns:
void
Example:
GetGroupMissionData
GetGroupMissionDataGets the active mission data for a group.
Location: server/services.lua
Parameters:
groupID(number) - The group ID
Returns:
table|nil- Mission data table ornilif no active mission
Example:
Groups Exports
FindGroupByMember
FindGroupByMemberFinds the group ID that a player belongs to.
Location: server/groups.lua
Parameters:
source(number) - The player's server ID
Returns:
number- The group ID, or0if player is not in a group
Example:
getGroupMembers
getGroupMembersGets all members of a group.
Location: server/groups.lua
Parameters:
groupID(number) - The group ID
Returns:
table- Array of player server IDs (leader first, then helpers)
Example:
IsGroupLeader
IsGroupLeaderChecks if a player is the leader of their group.
Location: server/groups.lua
Parameters:
source(number) - The player's server IDgroupID(number) - The group ID
Returns:
boolean-trueif player is the leader,falseotherwise
Example:
GetGroupName
GetGroupNameGets the name of a group.
Location: server/groups.lua
Parameters:
groupID(number) - The group ID
Returns:
string|nil- The group name, ornilif group doesn't exist
Example:
CreateBlipForGroup
CreateBlipForGroupCreates a blip for all members of a group.
Location: server/groups.lua
Parameters:
groupID(number) - The group IDname(string) - The blip name/identifierdata(table) - Blip data (sprite, color, coords, etc.)
Returns:
void
Example:
RemoveBlipForGroup
RemoveBlipForGroupRemoves a blip for all members of a group.
Location: server/groups.lua
Parameters:
groupID(number) - The group IDname(string) - The blip name/identifier to remove
Returns:
void
Example:
GroupEvent
GroupEventTriggers a client event for all members of a group.
Location: server/groups.lua
Parameters:
groupID(number) - The group IDevent(string) - The event name to triggerargs(table, optional) - Arguments to pass to the event
Returns:
void
Example:
Faction Exports
IsCompetitionInPausePeriod
IsCompetitionInPausePeriodChecks 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:
GetFactionId
GetFactionIdGets 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
AddFactionReputationAdds 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
AddFactionXPAdds 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
GetPlayerTerritoryBuffsGets 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
SetDeliveryRaceWaitingSets 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
ClearDeliveryRaceWaitingClears the waiting state for delivery race.
Location: server/delivery_race_server.lua
Parameters:
None
Returns:
void
Example:
Notes
All server exports require the resource name:
exports['mad-crimetablet']:ExportName()Client exports can be called from any client-side script
Most exports include validation and will return safe defaults (like
0orfalse) on invalid inputGroup-related exports work with the internal group system and require valid group IDs
Crypto exports validate crypto codes against the configuration (SCRPT, GG, RACE)
Service cooldowns are global and affect all players
Territory buffs are calculated based on the player's faction's controlled territories
Support
For issues or questions, please refer to the main documentation or contact support.
Last updated