Real Wallet / Features

Cards

Any item can be a card

A card is an ordinary ox_inventory item. Every item listed in Config.Cards fits in a wallet's card slots: ID cards, driver licenses, weapon licenses, bank cards, passes, memberships, key cards. Nothing is linked to an ID or bank script. Your scripts keep handing out their items as before, and the wallet reads them.

Lua
Config.Cards = {
    id_card        = { label = 'ID card',        design = 'id' },
    driver_license = { label = 'Driver license', design = 'license' },
    bank_card      = { label = 'Bank card',      design = 'credit', bank = 'Fleeca', kind = 'Debit' },
    gym_pass       = { label = 'Gym pass' },     -- the neutral placeholder design
}

Every option is on the Cards configuration page.

Getting cards in and out

From To How
Pocket Wallet F with the wallet out and nothing in your hand. The first card in your pockets goes in.
Wallet Hand Click the card.
Hand Wallet Click the wallet, right-click or X.
Hand Pocket F. The card is a normal inventory item again.
Hand Another player H. See Showing & handing cards.

With Config.AutoCollect = true, taking the wallet out first moves the player's own cards from their pockets into it. A card whose owner id is someone else stays in the pocket, and so does a card the player pocketed from the wallet on purpose. It is off by default.

The built-in designs

A card with no art of its own is drawn with one of five designs:

design What it looks like
'id' A San Andreas identification card.
'license' A San Andreas driver license, with a licence class.
'weapon' A San Andreas firearm permit, issued by the Office of the Sheriff.
'credit' A bank card: the bank name, chip, number in four groups, valid-thru date and the holder. Any colours.
'plain' The placeholder: a neutral card with the item's label on it. The default.

The words on them (the state name, titles, issuer, default bank) are in Config.CardText. Or give the item your own card art.

The details on a card

The card in your own hand is drawn with its real details: name, birth date, sex, height, card number, issue and expiry dates, licence class, signature and photo.

  • They are read from the card item's metadata, the data your ID script stored on it. The wallet looks for each detail under the names in Config.CardFields (for example firstname, firstName or first_name) and uses the first one it finds. Your items use other names? Add them there. See Your own ID and bank scripts.
  • On your own card, your character's details come first, so a name change shows at once. Anything your character does not have comes from the card.
  • On someone else's card (one you were handed or stole), only the card's own metadata is used.
  • A detail the card does not carry is made up from the card itself, the same every time: a card number, height, weight, eye and hair colour. An expiry date is set from the issue date (Config.CardText.validYears).
  • A card with no issue date gets one written onto its metadata (issued = 'YYYY-MM-DD') the first time its face is drawn (in a wallet that is out, or when it is shown), so its dates stay the same from then on.

Whose card is it? The card's owner is read from its metadata (citizenid, identifier, owner and the other names in Config.CardFields.owner). A card with no owner id counts as yours when it names you, or names nobody, so a card carrying neither an owner id nor a name shows the details of whoever holds it.

The photo

Card Photo
Your own card, in your hand A live photo of your character: MugShotBase64 when it runs, else the game's headshot (Config.RealCards.photo).
Someone else's card The photo stored on the card's metadata, if any. Otherwise a silhouette.
A card shown to you The photo stored on the card; for the shower's own card without one, their headshot.

A stored photo can be an https:// link, a data: image or plain base64.

Who sees what

  • You see your real cards on the props in your hand, drawn on your own screen.
  • Everyone else sees plain card props: the design's blank card, or the card's own art. No name or number ever goes to other players' games.
  • A player you show a card to sees that one card, with its details, in the card viewer.
Still stuck? Open a ticket in the Ryan Studios Discord and we'll help you out.