Providers
Custom

Custom provider

providers/<capability>/custom stays readable after escrow. auto never selects custom. Set Config.Use.<capability> = 'custom'. An id that is not in the catalog falls through to custom as well.

Each capability has client.lua, server.lua, or both. The file returns unless that id is selected, then hands its methods to Bridge.Provide. core/bind.lua publishes the public names, so the provider leaves exports() out.

if Bridge.Selected('framework') ~= 'custom' then return end
 
Bridge.Provide('framework', 'custom', {
    getMoney = function(source, account)
        return MyFramework.GetMoney(source, account or 'cash')
    end,
 
    addMoney = function(source, account, amount, reason)
        account, amount, reason = Bridge.MoneyArgs(account, amount, reason)
        return MyFramework.AddMoney(source, account, amount, Bridge.MoneyReason(reason)) == true
    end,
})

Keep every method that is already in the file. A missing method logs once and the call returns nil. The stubs already return the empty value for each signature (0, false, {}, or nil), so fill the ones your script can do and leave the rest.

Client methods describe the local player and take no server id. Where the same call exists on the server, source is the first argument.

Call this when the character finishes loading. Listeners that were registered earlier run immediately if the character is already loaded.

Bridge.RaisePlayerReady(source) -- server
Bridge.RaisePlayerReady()       -- client

Zones, health, armor, callbacks, and CheckVersion live in the core. They have no custom folder.

Helpers

Build return values with these so they match the shipped backends.

HelperResult
Bridge.Player(source, identifier, name, job, gang){ source, identifier, name, job, gang }
Bridge.Job(name, grade, label, onDuty, gradeLabel){ name, grade, label, gradeLabel, onDuty }. Empty args are unemployed and on duty. A gang with no membership is Bridge.Job('none', 0, 'none', false).
Bridge.Character(firstName, lastName, phone, gender, dateOfBirth){ firstName, lastName, phone, gender, dateOfBirth }
Bridge.MoneyArgs(account, amount, reason)Account name, amount, reason. A bare number is treated as a cash amount.
Bridge.MoneyReason(reason)The reason, or n_bridge when it was omitted.
Bridge.MatchesGroup(groups, identifier, filter)groups is { [name] = grade }. filter is a name, a list of names, or { name = minGrade }.
Bridge.JobCatalog(raw){ { name, label, grades = { { grade, name, label, isBoss } } } }
Bridge.ItemContext(name, count, metadata, slot){ name, count, metadata, slot }
Bridge.ItemRows(entries)Item rows from a slot table. Reads count or amount, and metadata or info.
Bridge.CountNamedItems(entries, item, metadata)Combined count. Metadata is matched with Bridge.MetadataMatches.
Bridge.SlotWithItem(entries, item, metadata)One ItemContext, or nil.
Bridge.NotifyParts(data)title, message, kind, duration, text. kind is info, success, warning, or error.
Bridge.ProgressData(data){ duration, label, canCancel, anim, disable }
Bridge.DispatchData(data)Normalized alert, including jobs and blip. On the server, Bridge.FillDispatchCoords(data) fills coords from data.source.
Bridge.PhoneNote(data){ sender, from, subject, message, address, title, description, app }
Bridge.InputFields(fields)One field shape: { type, label, name, default, required, options, min, max, placeholder }
Bridge.InputResult(fields, values)Values by position and by name, or nil when values is not a table.
Bridge.MenuData(data){ id, title, options }. Each option is { title, description, icon, disabled, arrow, onSelect, args }.
Bridge.Percent(value)The value clamped to 0–100, or nil when it is not a number.

RegisterUsableItem calls the inventory method registerUsable. That method may call Bridge.Call('framework', 'registerUsable', item, handler) when the framework owns usable items. The framework method must not call the inventory method back. handler(source, item) receives an ItemContext.

Framework

Server file providers/framework/custom/server.lua. Client file providers/framework/custom/client.lua.

CallMethodReturns
GetPlayer(source)getPlayerBridge.Player, or nil
GetPlayers()getPlayerslist of server ids
GetIdentifier(source)getIdentifierstring, or nil
GetPlayerJob(source)getJobBridge.Job
GetPlayerGang(source)getGangBridge.Job
SetPlayerJob(source, name, grade)setJobboolean
SetPlayerGang(source, name, grade)setGangboolean
SetJobDuty(source, onDuty)setDutyboolean
GetPlayerMoney(source, account)getMoneynumber. account is cash or bank.
AddPlayerMoney(source, account, amount, reason)addMoneyboolean
RemovePlayerMoney(source, account, amount, reason)removeMoneyboolean
SetPlayerMoney(source, account, amount, reason)setMoneyboolean
GetPlayerMetadata(source, key)getMetadatathe stored value, or nil
SetPlayerMetadata(source, key, value)setMetadataboolean
GetPlayerByIdentifier(identifier)getByIdentifierserver id, or nil
GetPlayerByPhone(number)getByPhoneserver id, or nil
GetPlayersByJob(job, onDuty)getPlayersByJoblist of server ids. onDuty limits the list to players on duty.
GetDutyCount(job)getDutyCountnumber
GetCharacter(source)getCharacterBridge.Character, or nil
IsBoss(source)isBossboolean
HasGroup(source, filter)hasGroupboolean. Bridge.MatchesGroup covers the filter shapes.
GetJobs()getJobsBridge.JobCatalog
GetGangs()getGangsBridge.JobCatalog
HasPermission(source, permission)hasPermissionboolean
RegisterUsableItemregisterUsable(item, handler)boolean

Client methods take no server id.

CallMethodReturns
GetPlayerData()getPlayerDataBridge.Player, or nil
IsPlayerLoaded()isLoadedboolean
GetIdentifier()getIdentifierstring, or nil
GetPlayerJob()getJobBridge.Job
GetPlayerGang()getGangBridge.Job
GetPlayerMoney(account)getMoneynumber
GetPlayerMetadata(key)getMetadatathe stored value, or nil
GetCharacter()getCharacterBridge.Character, or nil
IsBoss()isBossboolean
GetVehicleProperties(vehicle)getVehiclePropertiesthe framework's property table, or nil
SetVehicleProperties(vehicle, props)setVehiclePropertiesboolean

Inventory

Server file providers/inventory/custom/server.lua. Client file providers/inventory/custom/client.lua.

Rows are { name, count, metadata, slot, label }. Bridge.ItemRows, Bridge.CountNamedItems, and Bridge.SlotWithItem build them from a slot table that uses amount or info.

CallMethodReturns
GetItemCount(source, item, metadata)getCountnumber
HasItem(source, item, count, metadata)hasItemboolean
AddItem(source, item, count, metadata)addItemboolean
RemoveItem(source, item, count, metadata)removeItemboolean
CanCarry(source, item, count, metadata)canCarryboolean
GetItemLabel(item)getLabelstring
GetInventoryItems(source)getInventoryItemslist of rows
GetSlot(source, slot)getSlotone row, or nil
GetSlotWithItem(source, item, metadata)getSlotWithItemone row, or nil
SetItemMetadata(source, slot, metadata)setMetadataboolean
SetDurability(source, slot, value)setDurabilityboolean
ClearInventory(inventory, keep)clearboolean. inventory is a player id or a stash id. keep is an optional item name, or a list of names, to leave.
RegisterStash(id, label, slots, maxWeight, owner, groups, coords)registerStashboolean
ForceOpenInventory(playerId, kind, data)forceOpenboolean
CanCarryWeight(source, weight)canCarryWeightboolean
SetMaxWeight(source, weight)setMaxWeightboolean
GetPlayerWeight(source)getWeightnumber
GetPlayerMaxWeight(source)getMaxWeightnumber
CloseInventory(source)closeInventoryboolean
RegisterUsableItem(item, handler)registerUsableboolean

Client reads take no server id: getCount, hasItem, getLabel, getSlotWithItem, getWeight, getMaxWeight.

CallMethodReturns
GetPlayerItems()getItemslist of rows
GetCurrentWeapon()getWeaponone row, or nil
OpenInventory(kind, data)openInventoryboolean
CloseInventory()closeInventoryboolean
UseSlot(slot)useSlotboolean
SetStashTarget(id, owner)setStashTargetboolean
DisplayMetadata(metadata, value)displayMetadataboolean
GiveItemToTarget(serverId, slot, count)giveItemboolean

OpenInventory kinds are player, shop, stash, crafting, container, drop, glovebox, trunk, and dumpster.

Notify, progress, text UI, target

These are client files. Server Notify(target, data) relays to that player's client, so a custom notify only implements push.

push = function(data)
    local title, message, kind, duration = Bridge.NotifyParts(data)
end
CallMethodReturns
Notify(data)pushnothing. data is { title, description, kind, duration } or a string. The shipped stub prints it with the feed ticker.
Progress(data)starttrue when the bar finishes, false when it is cancelled. Use Bridge.ProgressData. disable keys are move, car, mouse, combat.
ShowText(text)shownothing
HideText()hidenothing
AddEntityTarget(entity, options)addEntityan id the matching remove understands
AddModelTarget(models, options)addModelan id
AddBoxZone(data)addBoxan id. data is { id, coords, size, rotation, options }.
RemoveTarget(id)removeboolean

Each target option is { name, label, icon, distance, onSelect, canInteract }.

Appearance

CallMethodReturns
GetAppearance() / GetAppearance(source)getAppearancethe clothing script's own appearance table. The client stub reads the local ped with Bridge.ReadPed.
SetAppearance(appearance)setAppearanceboolean
OpenAppearance(shopId)openAppearanceboolean. shopId is optional.
GetOutfits(source)getOutfitsa list, or {}
SetSkin / GetSkinsetSkin(ped, parts)boolean. The client stub is Bridge.ApplySkin, which dresses ped from { components, props }. Replace it only when the clothing script applies the skin itself.

Keys, fuel, boss menu

CallMethodReturns
GiveKeys(source, plate, model)giveKeysboolean. model is optional.
RemoveKeys(source, plate, model)removeKeysboolean
HasKeys(source, plate)hasKeysboolean
GiveKeys(plate, extra)giveKeysboolean. Client. extra is a server id for some key scripts and a vehicle entity for others.
RemoveKeys(plate, extra)removeKeysboolean
HasKeys(plate)hasKeysboolean
ToggleLock()toggleLockboolean
GetFuel(vehicle)getFuelnumber
SetFuel(vehicle, amount)setFuelboolean
OpenBossMenu()openboolean. The menu uses the local player's job from Bridge.Call('framework', 'getJob').

Phone

Normalize with Bridge.PhoneNote(data).

CallMethodReturns
SendPhoneMail(source, data)sendMailboolean. Uses sender, subject, message, address.
SendPhoneNotification(source, data)sendNotificationboolean. Uses title, description, app. Also implemented on the client, with no source.
SendPhoneMessage(source, data)sendMessageboolean. Uses from, sender, message.
GetPhoneNumber(source)getNumberstring, or nil
GetSourceByPhone(number)getSourceserver id, or nil
IsInPhoneCall(source)isInCallboolean
EndPhoneCall(source)endCallboolean
OpenPhone()openboolean
ClosePhone()closeboolean
IsPhoneOpen()isOpenboolean
SetPhoneDisabled(state)setDisabledboolean
IsPhoneDisabled()isDisabledboolean

Dispatch, society, vehicles

CallMethodReturns
SendDispatch(data)sendboolean. Read the payload from Bridge.DispatchData(data).
GetSocietyMoney(job)getMoneynumber
AddSocietyMoney(job, amount, reason)addMoneyboolean
RemoveSocietyMoney(job, amount, reason)removeMoneyboolean
GetOwnedVehicles(source)getOwned{ { plate, model, garage, state } }. state is garaged, out, or impounded.

Input and menu

open = function(title, fields)
    fields = Bridge.InputFields(fields)
    local values = MyUi.Ask(title, fields) -- nil when the player cancels
    return Bridge.InputResult(fields, values)
end

type is text, password, number, checkbox, select, textarea, slider, color, or date. options is { { value, label } }.

CallMethodReturns
InputDialog(title, fields)openBridge.InputResult, or nil
OpenMenu(data)openmenu id. Read the menu from Bridge.MenuData(data) and call each option's onSelect(args).
CloseMenu()closeboolean

Door lock, housing, skills, weather

CallMethodReturns
SetDoorState(id, locked, source)setStateboolean. source is optional.
GetDoorState(id)getStatetrue when locked, false when open, nil when unknown
GetClosestDoor()closest{ id, name, locked, distance }, or nil
GetCurrentProperty(source)currentPropertyproperty id, or nil when outside. The client method takes no source.
GetOwnedProperties(source)ownedPropertieslist of property ids
HasPropertyAccess(source, id)hasAccessboolean. True for the owner and for key holders.
GetSkillLevel(source, skill)getLevelnumber, or nil. The client method is getLevel(skill).
GetSkillXp(source, skill)getXpnumber, or nil
AddSkillXp(source, skill, amount)addXpboolean
RemoveSkillXp(source, skill, amount)removeXpboolean
SetSkillLevel(source, skill, level)setLevelboolean
SetWeather(kind)setWeatherboolean. kind is a GTA weather name such as CLEAR or RAIN.
SetTime(hour, minute)setTimeboolean
FreezeTime(state)freezeTimeboolean
GetWeather()getWeatherstring, or nil
GetTime()getTime{ hour, minute }, or nil
SetWeatherSync(enabled)setSyncboolean

Status

Values are 0 to 100. Clamp with Bridge.Percent.

CallMethodReturns
GetPlayerStatus(source, name)getnumber, or nil. The client method is get(name).
SetPlayerStatus(source, name, value)setboolean
AddPlayerStatus / RemovePlayerStatusadd(source, name, amount)boolean. Optional. amount is negative for a remove. With no add method, the bridge reads the value and calls set.
Join Our Discord