SIM Card Exports
Server exports for the SIM Card System. They let another resource hand a player a working phone number, take it away, move it between phone and inventory, and charge or refill its prepaid balance.These exports exist regardless of
Config.SimCardDLC. With the DLC disabled every write export answers { ok = false, error = 'simcard_disabled' } and every read export answers empty — your integration never crashes because a server owner turned the DLC off.Return shape
Write exports always return a table:Issuing
giveSimCard
Create a SIM card and put it into the player’s inventory.{ ok = true, number = string, simId = string, credits = number, inserted = boolean } or { ok = false, error = string }.inserted = false on an otherwise successful call means the SIM was created but did not fit into the phone (no phone, or max_sims_reached). The card is in the inventory — nothing was lost.removeSimCard
Destroy a SIM the player owns — inserted or in the inventory — and release its number.{ ok = true, number = string, from = 'phone' | 'inventory' } or { ok = false, error = string }.Moving SIMs
insertSimCard
Move a SIM from the inventory into the player’s phone.ejectSimCard
Take a SIM out of the phone and back into the inventory. The balance travels with it.setActiveSimCard
Make an inserted SIM the active one. This changes the player’s phone number immediately.{ ok = true, number = string, credits = number, simIndex = number } or { ok = false, error = string }.Credits
addSimCredits
Top up a SIM. Works on inserted SIMs and on SIM items in the inventory.{ ok = true, credits = number, number = string, from = 'phone' | 'inventory' } or { ok = false, error = string }.removeSimCredits
Deduct credits, e.g. for a premium hotline or a paid data service. Fails without changing anything when the balance is too low.{ ok = true, credits = number, number = string, from = 'phone' | 'inventory' } or { ok = false, error = string, credits = number }.Reading
getSimCards
Everything the player carries: SIMs inside the phone, which one is active, and loose SIM items in the inventory.getActiveSimNumber
The number the player currently calls and writes from.This is the same value the core
getNumberFromSource returns while the DLC is active — use whichever reads better in your resource.getSimCredits
Credit balance of one SIM.isSimNumberInUse
Is this number already issued to a SIM card? Covers cards whose owner is offline and cards that are not inserted into any phone.The core export
isPhoneNumberInUse only knows online phones and the users table. For SIM numbers, this is the export that answers correctly.Full example: company phone plan
Issuing a work SIM on hire and revoking it on dismissal, top-ups paid by the employer.Related Resources
SIM Card System
Configuration, credits, numbers and the player flow
Server Exports
The core server-side export surface