Skip to content

Exports

All exports are invoked via exports['gcphone-next']:ExportName(...).

Bridge (Server)

These exports wrap the active framework bridge (QBCore, ESX, QBOX, etc.) and provide a unified API.

ExportParametersReturnDescription
GetBridge--tableReturns the full bridge interface table.
GetIdentifiersource: integerstring|nilGet the player's framework identifier (e.g. citizenid, license).
GetNamesource: integerstring|nilGet the player's character name.
GetMoneysource: integer, accountType?: stringnumberGet the player's money balance. Returns 0 on failure.
AddMoneysource: integer, amount: number, accountType?: string, reason?: stringbooleanAdd money to the player's account.
RemoveMoneysource: integer, amount: number, accountType?: string, reason?: stringbooleanRemove money from the player's account.
GetJobsource: integertable|nilGet the player's current job/gang info.
GetFramework--string|nilGet the name of the detected framework.
GetSourceFromIdentifieridentifier: stringinteger|nilResolve a server source from a framework identifier.
IsPlayerActionAllowedsource: integerbooleanCheck if the player is allowed to perform phone actions (alive, not in jail, etc.).

Phone Management (Server)

ExportParametersReturnDescription
GetPhoneNumberidentifier: string, requestSource?: integerstring|nilGet a phone number by owner identifier. When requestSource is provided, access-control checks are enforced.
GetIdentifierByPhonephoneNumber: stringstring|nilResolve an owner identifier from a phone number.
GetPhoneByIdentifieridentifier: string, requestSource?: integerGCPhoneLookupResponseGet full phone record (number, IMEI, stolen state) for an identifier.
GetPhoneOwnerByIMEIimei: stringGCPhoneLookupResponseGet phone owner details by IMEI. Requires authorized caller.
GetPhoneOwnerByNumberphoneNumber: stringGCPhoneLookupResponseGet phone owner details by phone number. Requires authorized caller.
MarkPhoneAsStolenByIMEIimei: string, reason?: string, reporter?: stringGCPhoneStolenMutationResponseMark a phone as stolen by IMEI. Notifies owner if online.
MarkPhoneAsStolenByNumberphoneNumber: string, reason?: string, reporter?: stringGCPhoneStolenMutationResponseMark a phone as stolen by phone number. Notifies owner if online.
ClearPhoneStolenByIMEIimei: stringGCPhoneStolenMutationResponseClear stolen state by IMEI.
ClearPhoneStolenByNumberphoneNumber: stringGCPhoneStolenMutationResponseClear stolen state by phone number.
PlayerHasPhoneItemsource: integerbooleanCheck if a player has a phone item (ox_inventory). Always true when RequireItem is disabled.

Response Types

lua
-- GCPhoneLookupResponse
{ success = true, owner = { identifier, name, phoneNumber, imei, isStolen, stolenAt, stolenReason, stolenReporter } }
{ success = false, error = "UNAUTHORIZED" | "PHONE_NOT_FOUND" | "INVALID_IMEI" }

-- GCPhoneStolenMutationResponse
{ success = true, phone = { ... } }
{ success = false, error = "UNAUTHORIZED" | "PHONE_NOT_FOUND" | ... }

Notifications (Server)

ExportParametersReturnDescription
SendPhoneNotificationtarget: integer|integer[]|-1, payload: GCPhoneNotificationPayloadbooleanSend an ephemeral phone notification to one or more players. Use -1 to broadcast.
AddPersistentNotificationidentifier: string, payload: GCPhoneNotificationPayloadinteger|nilInsert a persistent notification into the DB and push it live if the owner is online. Returns the notification ID.

Notification Payload

lua
{
    title    = "Title",          -- required
    message  = "Body text",      -- notification body
    content  = "Body text",      -- alias for message
    app      = "messages",       -- app identifier
    appId    = "messages",       -- alias for app
    icon     = "./img/icon.svg", -- optional icon
    avatar   = "url",            -- optional avatar
    priority = "high",           -- bypasses DND/mute when "high"
    route    = "/messages",      -- optional deep-link route
    data     = {},               -- optional payload passed to the app
    meta     = {},               -- optional metadata (persistent only)
}

Security (Server)

ExportParametersReturnDescription
HitRateLimitsource: integer, key: string, windowMs: integer, maxHits?: integerbooleanHit a named rate-limit bucket. Returns true if the limit was exceeded.
IsBlockedByIdentifieridentifier: stringbooleanCheck if an identifier is blocked from social features.
IsBlockedEitheridentifierA: string, identifierB: stringbooleanCheck if either side of a social interaction is blocked.
RecordReportreporterIdentifier: string, targetIdentifier?: string, targetPhone?: string, appId?: string, evidence?: string|tablenilRecord a moderation report.

Hooks (Server)

ExportParametersReturnDescription
registerHookevent: string, cb: function, options?: tableinteger|falseRegister a hook callback for a phone event. Returns hook ID.
removeHooksid?: integernilRemove hooks registered by the calling resource. Pass an ID to remove a specific hook.
triggerHookevent: string, payload?: tablebooleanTrigger a hook event. Returns false if any hook cancelled it.

See hooks.md for the full hook system documentation.

Messages (Server)

ExportParametersReturnDescription
GetMessagesidentifier: string, requestSource?: integertable[]Get recent message threads for an identifier.
GetConversationidentifier: string, targetNumber: string, requestSource?: integertable[]Get a conversation with a specific phone number.

Mail (Server)

ExportParametersReturnDescription
SendInGameMailfromIdentifier: string, payload: tabletableSend in-game mail from an identifier. The sender must have a mail account. Returns { success, error? }.

Calls (Server)

ExportParametersReturnDescription
GetActiveCalls--table<integer, table>Get all currently active calls indexed by call ID.
GetCallHistoryidentifier: string, requestSource?: integertable[]Get call history rows for a player identifier.

Contacts (Server)

ExportParametersReturnDescription
GetContactsidentifier: string, requestSource?: integertable[]Get the contact list for an identifier.
ExportParametersReturnDescription
GetGalleryidentifier: string, requestSource?: integertable[]Get gallery media for a phone owner.

Live (Server)

ExportParametersReturnDescription
GetLiveRoomclipId: integertable|nilGet an active live room by clip/post ID.

Wallet (Server)

ExportParametersReturnDescription
CanUseProximityPaymentsource: integer, targetSource: integer, maxDistance?: numberboolean, string|nil, number|nilCheck if two players can use proximity payment. Returns (allowed, errorCode, distance).
ProximityTransfersource: integer, targetSource: integer, amount: number, title?: string, method?: 'qr'|'nfc'GCWalletTransferResponseExecute a proximity wallet transfer between two players.

Garage (Server)

Registration

ExportParametersReturnDescription
RegisterGarageSpawnPointid: string, point: GaragePointnilRegister a single garage spawn point.
RegisterImpoundLocationid: string, point: GaragePointnilRegister a single impound location.
RegisterGarageSpawnPointslist: GaragePoint[], prefix?: stringnumberBatch-register spawn points. Returns the count registered.
RegisterImpoundLocationslist: GaragePoint[], prefix?: stringnumberBatch-register impound locations. Returns the count registered.

Removal

ExportParametersReturnDescription
RemoveGarageSpawnPointid: stringnilRemove a spawn point by ID.
RemoveImpoundLocationid: stringnilRemove an impound location by ID.
ClearGarageSpawnPointsprefix?: stringnilClear spawn points. If prefix given, only clears matching IDs.
ClearImpoundLocationsprefix?: stringnilClear impound locations. If prefix given, only clears matching IDs.

Providers

ExportParametersReturnDescription
SetSpawnPointProviderfn: fun(source): GaragePoint[]|nilnilSet a dynamic callback for additional spawn points. Pass nil to remove.
SetImpoundProviderfn: fun(source): GaragePoint[]|nilnilSet a dynamic callback for additional impound locations. Pass nil to remove.

Query

ExportParametersReturnDescription
GetGarageSpawnPoints--table<string, GaragePoint>Get all registered spawn points.
GetImpoundLocations--table<string, GaragePoint>Get all registered impound locations.
GetNearestSpawnPointsource: numberGaragePoint|nilGet the nearest spawn point to a player.
GetNearestImpoundsource: numberGaragePoint|nilGet the nearest impound location to a player.

Sync

ExportParametersReturnDescription
SyncVehicleidentifier: string, plate: string, model: string|number, modelName?: string, garageName?: string, impounded?: boolean, properties?: table, coords?: vector3|tablebooleanInsert or update a vehicle entry from an external garage resource.

GaragePoint Type

lua
{ id? = "string", label = "string", x = number, y = number, z = number, h? = number }

Database (Server)

ExportParametersReturnDescription
RunMigrations--nilRun pending database migrations.
GetDatabaseVersion--integerGet the current database schema version.

Phone UI (Client)

ExportParametersReturnDescription
GetPhoneState--tableGet the full phone state table (phoneNumber, wallpaper, volume, etc.).
IsPhoneOpen--booleanCheck whether the phone UI is currently open.
NotifyPhonepayload: GCPhoneNotificationPayloadbooleanPush a local phone notification from client Lua.
TogglePhone--nilToggle the phone open/closed state.
ClosePhone--nilForce the phone closed if it is open.
SetPhoneVisualModemode: string, options?: tablenilSet the current phone visual mode (e.g. "text", "call", "camera").
GetPhoneVisualMode--string, tableGet the current phone visual mode and its options.

Calls (Client)

ExportParametersReturnDescription
IsInCall--booleanCheck if the player is currently in a call.
GetCurrentCallId--integer|nilGet the current active call ID.

Music (Client)

ExportParametersReturnDescription
isPlayingMusic--booleanCheck if music is currently playing.
isMusicPaused--booleanCheck if music playback is paused.
getCurrentMusicUrl--string|nilGet the URL of the currently playing track.

Flashlight (Client)

ExportParametersReturnDescription
SetPhoneFlashlightEnabledenabled: booleannilEnable or disable the phone flashlight.
IsPhoneFlashlightEnabled--booleanCheck if the phone flashlight is on.
GetPhoneFlashlightProfile--tableGet the current flashlight profile settings.

Native Audio (Client)

ExportParametersReturnDescription
PlayPhoneNativeTonetone: string, ...nilPlay a native phone tone (ring, notification, etc.).
StopPhoneNativeCallTone--nilStop the active call ringtone.
StopPhoneNativePreviewTone--nilStop the preview tone playback.
StopPhoneNativeOutgoingTone--nilStop the outgoing call tone.
IsPhoneNativeCallToneEnabled--booleanCheck if native call tone is enabled.

Phone Animation (Client)

ExportParametersReturnDescription
PlayPhoneAnimationanim: stringnilPlay a named phone animation.
PhonePlayIn--nilPlay the phone-in (pull out) animation.
PhonePlayOut--nilPlay the phone-out (put away) animation.
PhonePlayCall--nilPlay the phone call hold animation.
PhonePlayText--nilPlay the texting animation.
PhonePlayCamera--nilPlay the camera mode animation.
PhonePlayLive--nilPlay the live streaming animation.

Proximity (Client)

ExportParametersReturnDescription
GetSnapLiveAudioStatus--tableGet the current Snap live audio streaming status.
GetNearbyPlayers--table[]Get a list of nearby players for proximity features.

Released under GPL-3.0 License