Server Exports
Each export below is expandable. Open one to view description, arguments, return value, and usage examples.
General & Config
GetConfig
Returns the full runtime player-facing configuration table, or a specific section if a key is provided.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
section | string | No | If provided, returns only that section (e.g. 'apps', 'general'). |
Returns table
Example
-- Get the full config
local config = exports['fs_trapphone_v2']:GetConfig()
-- Get only the apps section
local apps = exports['fs_trapphone_v2']:GetConfig('apps')GetBridgeSelection
Returns the currently active bridge provider for a given category.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
category | string | Yes | One of: 'framework', 'inventory', 'target', 'dispatch', 'lockpick'. |
Returns string — the selected bridge key, e.g. 'ox_inventory', 'auto'.
Example
local inv = exports['fs_trapphone_v2']:GetBridgeSelection('inventory')
-- e.g. "ox_inventory"
local fw = exports['fs_trapphone_v2']:GetBridgeSelection('framework')
-- e.g. "esx"Player Progression & XP
GetPlayerXP
Returns the player's total criminal XP and computed level.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns table — { total = number, level = number }
Example
local xp = exports['fs_trapphone_v2']:GetPlayerXP(source)
print(xp.total, xp.level)GetPlayerAppXP
Returns the XP and level specifically earned inside one app.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
appName | string | Yes | App name: 'Burner', 'Signal', 'Corner', 'Delivery', 'traphouse', 'Taxi'. |
Returns table — { total = number, level = number }
Example
local data = exports['fs_trapphone_v2']:GetPlayerAppXP(source, 'Corner')
print(data.total, data.level)IsAppEnabled
Checks whether a specific app is enabled in the server configuration.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
appName | string | Yes | App name to check (e.g. 'Signal', 'Corner', 'Delivery'). |
Returns boolean
Example
if exports['fs_trapphone_v2']:IsAppEnabled('Delivery') then
-- delivery app is on
endHasAppUnlocked
Checks whether a player has unlocked a specific app based on XP level or permission rules.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
appName | string | Yes | App name to check. |
Returns boolean
Example
local unlocked = exports['fs_trapphone_v2']:HasAppUnlocked(source, 'Delivery')CanUseApp
Checks both enabled status and unlock state for a player and app in one call.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
appName | string | Yes | App name to check. |
Returns table — { ok = boolean, reason = string, app = string }
Example
local result = exports['fs_trapphone_v2']:CanUseApp(source, 'Signal')
if result.ok then
-- player can use Signal
endPhone Item & Sessions
HasTrapPhoneItem
Returns true if the player currently holds the trap phone item in their inventory.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns boolean
Example
local hasPhone = exports['fs_trapphone_v2']:HasTrapPhoneItem(source)GetTrapPhoneItemName
Returns the configured inventory item name for the trap phone.
Arguments
None.
Returns string — e.g. 'fs_trapphone'
Example
local itemName = exports['fs_trapphone_v2']:GetTrapPhoneItemName()HasActivePhoneSession
Returns true if the player is currently in an active mission or deal session.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns boolean
Example
if exports['fs_trapphone_v2']:HasActivePhoneSession(source) then
-- player is busy
endGetActivePhoneSession
Returns the full active session state table for the player, or nil if no session is active.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns table | nil
Example
local session = exports['fs_trapphone_v2']:GetActivePhoneSession(source)
if session then
print(session.app, session.appName)
endCancelActivePhoneSession
Forcefully cancels any ongoing criminal mission or deal session for the player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
reason | string | No | Reason string for logging. Defaults to 'external_cancel'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:CancelActivePhoneSession(source, 'arrested_by_police')Burner Phone & Contacts
GetBurnerNumber
Returns the player's assigned burner phone number.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns string | nil
Example
local number = exports['fs_trapphone_v2']:GetBurnerNumber(source)GetBurnerContacts
Returns the list of all contacts currently unlocked by the player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns table — array of contact tables.
Example
local contacts = exports['fs_trapphone_v2']:GetBurnerContacts(source)
for _, c in ipairs(contacts) do print(c.id, c.label) endIsBurnerContactUnlocked
Checks whether a player has a specific contact unlocked.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
numberOrId | string | Yes | Contact ID or phone number to check. |
Returns boolean
Example
local isUnlocked = exports['fs_trapphone_v2']:IsBurnerContactUnlocked(source, 'dealer_01')UnlockBurnerContact
Unlocks a specific NPC contact for one player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
numberOrId | string | Yes | Contact ID or phone number to unlock. |
reason | string | No | Reason for logging. Defaults to 'external_unlock'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:UnlockBurnerContact(source, 'dealer_01', 'quest_reward')ForceUnlockBurnerContact
Unlocks a contact for a player bypassing XP or item cost checks.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
numberOrId | string | Yes | Contact ID or phone number. |
reason | string | No | Defaults to 'external_force_unlock'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:ForceUnlockBurnerContact(source, 'vip_dealer', 'admin_grant')UnlockBurnerContactForAll
Unlocks a contact globally for every online player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
numberOrId | string | Yes | Contact ID or phone number. |
reason | string | No | Defaults to 'external_unlock_all'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:UnlockBurnerContactForAll('event_dealer', 'server_event')LockBurnerContact
Re-locks a contact for a specific player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
numberOrId | string | Yes | Contact ID or phone number. |
reason | string | No | Defaults to 'external_lock'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:LockBurnerContact(source, 'dealer_01', 'banned_from_contact')GetBurnerDealState
Returns the current in-progress Burner deal/meeting state for a player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns table — { ok = boolean, ... deal state fields ... }
Example
local deal = exports['fs_trapphone_v2']:GetBurnerDealState(source)CancelBurnerDeal
Forcefully cancels an in-progress Burner deal/meeting for a player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
reason | string | No | Defaults to 'external_cancel'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:CancelBurnerDeal(source, 'police_interference')Signal Hotline
CanStartSignal
Checks whether a player is eligible to activate the Signal hotline.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns table — { ok = boolean, reason = string }
Example
local result = exports['fs_trapphone_v2']:CanStartSignal(source)IsSignalActive
Returns true if the player's Signal hotline is currently active.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns boolean
Example
if exports['fs_trapphone_v2']:IsSignalActive(source) then
-- signal hotline is live
endGetSignalState
Returns the full Signal session state for a player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns table — { ok = boolean, ... session fields ... }
Example
local state = exports['fs_trapphone_v2']:GetSignalState(source)StartSignal
Activates the Signal buyer hotline for the player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
reason | string | No | Defaults to 'external_start'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:StartSignal(source)StopSignal
Stops the Signal buyer hotline for the player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
reason | string | No | Defaults to 'external_stop'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:StopSignal(source, 'player_logged_out')ForceSignalCooldown
Forces a cooldown period on the Signal app for a player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
minutes | number | Yes | Cooldown duration in minutes. |
reason | string | No | Defaults to 'external_cooldown'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:ForceSignalCooldown(source, 30, 'admin_penalty')Corner Selling
CanStartCorner
Checks whether a player is eligible to begin corner selling.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns table — { ok = boolean, reason = string }
Example
local result = exports['fs_trapphone_v2']:CanStartCorner(source)IsCornerActive
Returns true if the player is currently actively corner selling.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns boolean
Example
if exports['fs_trapphone_v2']:IsCornerActive(source) then
-- player is selling on a corner
endStartCorner
Activates on-foot street corner selling for the player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
locationId | string | No | Specific corner location ID to force. Optional. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:StartCorner(source)StopCorner
Stops corner selling for the player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
reason | string | No | Defaults to 'external_stop'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:StopCorner(source, 'police_nearby')ForceCornerCooldown
Forces a cooldown period on the Corner app for a player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
minutes | number | Yes | Cooldown duration in minutes. |
reason | string | No | Defaults to 'external_cooldown'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:ForceCornerCooldown(source, 15, 'caught_by_police')Delivery Missions
CanStartDelivery
Checks whether a player is eligible to begin a wholesale delivery mission.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns table — { ok = boolean, reason = string }
Example
local result = exports['fs_trapphone_v2']:CanStartDelivery(source)IsDeliveryActive
Returns true if the player currently has an active delivery mission.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns boolean
Example
if exports['fs_trapphone_v2']:IsDeliveryActive(source) then
-- player is on a delivery
endGetDeliveryState
Returns the full delivery mission state for the player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns table — { ok = boolean, ... delivery state fields ... }
Example
local state = exports['fs_trapphone_v2']:GetDeliveryState(source)StartDelivery
Starts a wholesale delivery mission for the player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
risk | string | No | Risk level: 'low', 'medium', 'high'. Defaults to 'low'. |
reason | string | No | Defaults to 'external_start'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:StartDelivery(source, 'high')StopDelivery
Cancels the player's active delivery mission.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
reason | string | No | Defaults to 'external_stop'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:StopDelivery(source, 'mission_failed')ForceDeliveryCooldown
Forces a cooldown period on the Delivery app for a player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
minutes | number | Yes | Cooldown duration in minutes. |
reason | string | No | Defaults to 'external_cooldown'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:ForceDeliveryCooldown(source, 60, 'busted_mid_run')Trap House Operations
CanRequestTrapHouseJob
Checks whether a player can request access to a specific trap house location.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
trapHouseId | string | No | Specific location ID to validate. Optional. |
Returns table — { ok = boolean, reason = string, app = string }
Example
local result = exports['fs_trapphone_v2']:CanRequestTrapHouseJob(source, 'grove_trap')CanStartTrapHouse
Checks whether a player can start a trap house raid.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
houseId | string | No | Specific house ID to check. Optional. |
Returns table — { ok = boolean, reason = string }
Example
local result = exports['fs_trapphone_v2']:CanStartTrapHouse(source, 'grove_trap')IsTrapHouseActive
Returns true if the player is currently inside an active safehouse raid.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns boolean
Example
if exports['fs_trapphone_v2']:IsTrapHouseActive(source) then
-- player is raiding
endGetTrapHouseState
Returns active trap house locations, raid sessions, and cooldown timers.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
Returns table — { app = string, enabled = boolean, locations = table, runtime = table }
Example
local state = exports['fs_trapphone_v2']:GetTrapHouseState(source)StartTrapHouse
Activates a trap house raid session for the player.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
houseId | string | No | Specific trap house location ID. Optional. |
reason | string | No | Defaults to 'external_start'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:StartTrapHouse(source, 'grove_trap')StopTrapHouse
Stops the player's active trap house raid.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID of the player. |
reason | string | No | Defaults to 'external_stop'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:StopTrapHouse(source, 'raid_interrupted')ForceTrapHouseCooldown
Sets a forced cooldown on a trap house location by ID.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
source | number | Yes | Server source ID (used for context). |
minutes | number | Yes | Cooldown duration in minutes. |
reason | string | No | Defaults to 'external_cooldown'. |
Returns table — { ok = boolean, reason = string }
Example
exports['fs_trapphone_v2']:ForceTrapHouseCooldown(source, 60, 'admin_lockdown')