Real Wallet / Developers
Framework bridge
bridge/framework/server.lua and bridge/framework/client.lua are open (not escrowed). Everything the wallet needs to
know about a character, and how it reads a card item, comes from here.
Server: bridge/framework/server.lua
| Function | Returns |
|---|---|
Bridge.GetIdentifier(src) |
The character's id (citizenid / identifier / license): who owns a card. |
Bridge.GetCharacter(src) |
{ firstname, lastname, dob, sex = 'M' / 'F', nationality, height } for the card faces. |
Bridge.OnPlayerLoaded(cb) |
Calls cb(src) when a character has loaded (the starter wallet). |
Bridge.CardField(meta, field) |
One detail of a card from its metadata, under any of its Config.CardFields names, or nil. |
Bridge.CardOwner(meta) |
Whose card an item is, from its metadata. nil = nobody's (it counts as the holder's own). |
Bridge.CardPerson(meta) |
The name, birth date, sex, nationality and height printed on a card, from its metadata. |
Bridge.CardPhoto(meta) |
The photo stored on a card as an https:// or data: link, or nil. |
Bridge.Name |
The framework in use: 'qbx_core', 'qb-core', 'es_extended' or 'standalone'. |
Built in
| Framework | Character id | Character details | Loaded event |
|---|---|---|---|
qbx_core |
PlayerData.citizenid |
PlayerData.charinfo |
QBCore:Server:PlayerLoaded (and qbx_core:server:playerLoaded) |
qb-core |
PlayerData.citizenid |
PlayerData.charinfo |
QBCore:Server:PlayerLoaded |
es_extended |
xPlayer.identifier |
firstName, lastName, dateofbirth, sex, height |
esx:playerLoaded |
standalone |
The player's license2 / license |
Their FiveM name | playerJoining (+5 s) |
Adding another framework
Add one entry to the FRAMEWORKS table with three functions, then set Config.Framework to its name:
Lua
my_framework = {
identifier = function(src)
local p = exports.my_framework:GetPlayer(src)
return p and p.charId
end,
character = function(src)
local p = exports.my_framework:GetPlayer(src)
if not p then return end
return { firstname = p.firstName, lastname = p.lastName, dob = p.dob, sex = p.female and 'F' or 'M' }
end,
loaded = function(cb)
AddEventHandler('my_framework:characterLoaded', function(src) cb(src) end)
end,
},
To pick it with Config.Framework = 'auto' too, add its resource name to the list in pick().
Client: bridge/framework/client.lua
| Function | What it does |
|---|---|
Bridge.CanUse() |
false while the player must not take the wallet out, and puts it away if it is out. Built in: dead or cuffed (the game's own state and the isDead, dead, isCuffed, handcuffed state bags). Add your own checks here: a job, a zone, a knocked-down state of your medical script. |
Bridge.Photo(ped) |
The photo on your own cards: a data: image (MugShotBase64) or the game's headshot, as set by Config.RealCards.photo. nil = a silhouette. |
Lua
function Bridge.CanUse()
local ped = cache.ped
if IsEntityDead(ped) or IsPedCuffed(ped) then return false end
local st = LocalPlayer.state
if st.isDead or st.dead or st.isCuffed or st.handcuffed then return false end
if st.isLaststand then return false end -- your own check, e.g. a downed state
return true
end
Still stuck? Open a ticket in the Ryan Studios Discord and we'll help you out.