Features

SIM cards

The two SIM slots, SIM cards, two lines and the GhostNet card.

A phone has two SIM slots, SIM 1 and SIM 2, shown together on one screen: Settings > SIM (the row is called SIM & Cellular). Each slot holds one card, and there are two kinds of card:

Card Config What it is
SIM card Config.Sim A phone line. The phone number lives on the SIM, so whoever has the SIM in their phone has the number
GhostNet card Config.SecondSim An off-the-books card with no number. It works for a few days and opens the apps you choose (the illegal ones)

Two SIM cards in one phone give it two lines. A SIM card and a GhostNet card give it one line plus the GhostNet apps. The two systems are independent: you can use one, both or neither.

#1. Settings > SIM

The top of the screen shows the two slots as cards: the network, and the number (or, for a GhostNet card, its line id). An empty slot shows Empty with a plus. Tapping a slot shows what is in it below.

The slot holds What the screen shows
A SIM card Carrier, number, type (Physical SIM, eSIM or Built-in Line), status, when it went in, the ICCID, who it is registered to, and the last 20 history entries of the card (issued, inserted, ejected, blocked and so on). Eject SIM at the bottom
A GhostNet card The time left as a bar, a switch to turn the line off and on, the line id, the state (On, Off or Expired), when it went in and when it runs out, the apps tied to it, and Eject SIM
Nothing Your Cards for SIM 1 (or 2): the cards the player carries, ready to go into this slot

With two lines in the phone a Lines section is added at the bottom (see section 3).

#Putting a card in

There are two ways:

  • From the inventory. Using a SIM card or a GhostNet card from the inventory opens the phone on Settings > SIM with that card offered: "... is ready to insert. Which slot?", with a SIM 1 and a SIM 2 button.
  • From the phone. Tapping an empty slot lists the cards in the inventory. Tapping one puts it in that slot.

The list shows:

Card Shown as
A SIM with a number The number, and who it is registered to (or "Prepaid SIM")
A blank SIM (no metadata, bought from any shop) New SIM Card. It gets a number the first time it is used or goes in
A GhostNet card A new one with the days it will work, a used one with its line id and the time it has left
The player's own eSIM that is switched off The number, marked eSIM

Cards that cannot be used are greyed out: a blocked SIM, a lost one (Dead Card), a GhostNet card whose time is over, and, with LockToOwner = true, a registered SIM that belongs to someone else.

Putting a card into a slot that is already in use swaps them. For a SIM the phone asks first. The old card goes back to the inventory (an eSIM is switched off instead).

#Taking a card out

Eject SIM takes the card out of the selected slot:

  • A physical SIM goes back to the inventory. The item says which number it is (see below).
  • An eSIM is switched off. Only its owner can switch it on again, from the card list of an empty slot.
  • A GhostNet card goes back to the inventory or is destroyed, see section 4.

The player needs room in the inventory, or the card stays in ("No room in your inventory.").

#Rules for both slots

  • A card cannot be put in or taken out during a call.
  • After a SIM goes into a slot, that slot takes no other SIM for Config.Sim.SwapCooldown seconds. The cooldown is per slot: the other slot is not affected, and GhostNet cards ignore it.
  • A phone holds at most one GhostNet card.

#2. SIM cards (Config.Sim)

#With Enabled = true (as shipped)

The number belongs to the SIM. Whoever has the SIM in their phone has the number.

  • Take the SIM out and its number leaves the phone. Calls and messages to that number no longer reach this phone. If it was the only line, the phone has no number: the status bar shows "No SIM" and only emergency numbers can be called.
  • Put it back and everything returns. Chats and call history belong to the number, so they come back with it.
  • Put it in another phone and the number works there. That phone rings for the number, calls and texts from it, and sees its chats and call history. This is how a player lends their number to someone (with LockToOwner = false, the shipped value).
  • A SIM is a real inventory item. It can be bought, handed over, dropped, stolen or lost.

The item carries its ICCID and number as metadata. With ItemText = true (default) the item also says whose number it is: its name becomes "FX Mobile · 555-0123" and its description lists the number, the carrier and who it is registered to (or "Prepaid line"). These are the name and description ox_inventory shows. With ItemText = false the item keeps its plain name; the number is still in its metadata.

#With Enabled = false

Every character keeps one built-in number. Settings > SIM shows it in slot 1 as Built-in Line; it cannot be taken out, and there is nothing to buy, insert or lose. Slot 2 only takes a GhostNet card.

#The first line (Starter)

Starter decides what a phone's first SIM is:

Value The first SIM
'physical' (shipped) A real card registered to the character, already in slot 1. It can be taken out and handed over like any other SIM
'esim' Built into the phone. It can be switched off and on, but never changes hands

It applies to new characters and to phones that get their first SIM when the system is switched on. Nobody loses a number when you switch it on: every phone that has a number but no SIM receives its first SIM, with that same number, on the first start. Phones that already have a SIM keep it; changing Starter later does not convert them.

#Kinds of SIM

Kind What it is
Physical SIM The Config.Sim.Item item (default sim_card). The card carries its ICCID and number as item metadata
eSIM No item. It lives in the phone. A new eSIM switches on in a free slot
Type What it means
Registered Sold with the buyer's name on it. Calls and messages can be traced to that person
Prepaid (unregistered) Sold without a name. Only the buyer is recorded. Can be registered later at a phone shop

#Rules

  • With LockToOwner = true a registered SIM only works in its owner's phone, so it cannot be lent, and a stolen one is useless. Prepaid SIMs work in any phone. The shipped value is false: any SIM works in any phone.
  • A character can have at most MaxPerPlayer registered SIMs.
  • A blocked SIM stays in the phone but gives no service. If it is the phone's only SIM, the status bar shows "SOS" and only emergency numbers can be called. A second line in the same phone keeps working.
  • A SIM reported lost stops working and shows as a Dead Card. The owner gets a new card with the same number (reissue).

#Emergency numbers

EmergencyNumbers maps a dialled number to a job. Dialling it rings that job's company line in the Services app. It works with no SIM, with a blocked SIM and with no number at all. The numbers are also listed at the top of Contacts.

luaEmergencyNumbers = { ['911'] = 'police', ['912'] = 'ambulance' },

#Where SIMs come from

Phone shop (Config.PhoneShop.Products):

Product What the player gets
sim A registered physical SIM with a new number
sim_prepaid A prepaid physical SIM with a new number
esim A registered eSIM. It switches on in a free slot; refused when both slots are taken
reissue A new card with the same number, for a lost SIM. The old card stops working
number_change A new number for one SIM in the phone. With two SIMs in, the shop asks which line. Refused for a registered SIM that belongs to someone else

Any other shop. A sim_card item with no metadata is a blank prepaid SIM. The first time a player uses it or puts it in, the server gives it a number and writes the metadata onto the item. So any shop script can sell SIMs without calling an export. Set AllowUnregistered = false to refuse blank cards.

Your own script. IssueSim creates a SIM; see Server exports: SIM.

#Staff tools

The admin tablet has a SIM section: search by number or name, see who a SIM is registered to and who bought it, block and unblock, register, reissue and delete.

For police scripts, GetSimOwner(number) returns the same record: the registered owner, or for a prepaid SIM the buyer and the shop.

#Options

Option Default What it does
Enabled true The number lives on the SIM. false: one built-in number per character
Item 'sim_card' Inventory item of a physical SIM
Carrier 'FX Mobile' Network name shown in Settings, the status bar and on the item
Starter 'physical' A phone's first SIM: 'physical' (a card in slot 1 that can be taken out) or 'esim' (built in)
ItemText true The item's name and description show the number and who it is registered to
AllowUnregistered true Prepaid SIMs exist, and blank cards from other shops work
LockToOwner false true: a registered SIM only works in its owner's phone, so it cannot be lent
MaxPerPlayer 5 Registered SIMs per character
SwapCooldown 30 Seconds before a slot takes another SIM
EmergencyNumbers 911, 912 Number dialled, and the job whose line rings

#Setting it up

  1. Add the sim_card item and its image to your inventory: Item setup.
  2. Check Config.Sim: Enabled = true is the shipped value. Pick Starter and LockToOwner.
  3. Restart the server. Existing phones receive their first SIM on this start.

The database is updated by itself on start. There is nothing to run by hand.

#Events

Event Side Arguments When
fx-phone:sim:changed client sim or nil The SIMs in this player's phone changed. sim is the primary line's SIM
fx-phone:server:simIssued server { iccid, number, identifier, kind, registered } A SIM was created
fx-phone:server:simBlocked server { iccid, number, reason } A SIM was blocked

#3. Two lines

Two SIMs with numbers in one phone give it two lines.

  • Both numbers ring in the phone. Recents and Messages show the calls and threads of both lines in the same lists, each tagged with its slot number (1 or 2). The call screen shows which line a call is on.
  • The primary line is the phone's own number. Calls and messages go out on it unless the player picks the other line, and every app uses it. It is also what GetPhoneNumber returns.
  • Settings > SIM > Lines sets it up:
Setting Choices
Primary Line SIM 1 or SIM 2
Calls Primary Line, or Ask Every Time (the phone asks which line before each call)
New Messages Primary Line, or Ask Every Time
  • The keypad and the New Message screen show a switch to pick the line. Calling back from Recents uses the line the call was on.
  • A phone cannot call or text its own other line.
  • If the primary line's SIM comes out or is blocked, the other line takes over until it is back.

Status bar. With both slots in use (two SIMs, or a SIM and a GhostNet card) the status bar shows two sets of signal bars, numbered 1 and 2.

#4. GhostNet card (Config.SecondSim)

A card for the underworld. It is an item, it works for a few days, then it dies. While it works, the apps you list open. Without it they show SIM Not Authorized.

It has no phone number, only a line id such as GN-4F2A-9C17, so nobody can call it and it does not count as a line. It does not need Config.Sim.Enabled.

#How it works for the player

  1. The player gets the item (default ghost_sim) from wherever you sell it: a black market, a dealer, a job reward.
  2. Using it opens Settings > SIM with the card offered for SIM 1 or SIM 2. It can also be picked from the card list of an empty slot. Put into a slot that holds a SIM, that SIM comes out as in a swap. With Config.Sim.Enabled = false only slot 2 takes it.
  3. The apps in Apps open.
  4. A new card works for Days days from the moment it first goes in. Then it expires, the line is shut off and the apps close again.

In Settings > SIM the GhostNet slot shows the time left and a switch, Turn On This Line. Switched off, the apps tied to it do not open. The time keeps running either way.

#Taking it out (Returnable)

Returnable A card with time left An expired card
true (default) Goes back to the inventory with its line id and end date written on it. The item shows "GhostNet · GN-..." and when it runs out. It can be handed to someone else, who gets the same line and whatever time is left Thrown away
false Destroyed. It does not return to the inventory Thrown away

The clock never stops, in the phone or out of it. A card whose time ran out while it sat in an inventory cannot be put in again ("This card's time is over.").

#The "SIM Not Authorized" screen

An app listed in Apps shows this screen instead of opening when:

Reason Shown as
No GhostNet card in the phone NO_CARD
The line is switched off in Settings LINE_DOWN
The card has expired EXPIRED

The screen has a button to Settings > SIM. When the line comes up the app opens by itself, no restart needed.

The check is also made on the server: every request of a listed app is refused without a working card, so the screen cannot be bypassed.

#When a card is shut off

Cards are shut off by a check that runs every CheckHours hours, not at the exact second they expire. A card therefore keeps working until the first check after its last day, up to CheckHours longer.

The player gets a notification WarnHours hours before the card runs out, and another when it is shut off.

#Putting in a second card

A phone holds one GhostNet card, so another card always goes to the slot of the one already in. Stack decides what happens when a player puts in another while one still works:

Value Result
'extend' The new card's days are added on top (for a used card, the time it had left), never further ahead than MaxDays from now. The new card is used up
'replace' The card in the phone comes out (back to the inventory with Returnable = true) and the new one goes in
'refuse' Nothing happens and the card stays in the inventory

An expired card in the phone is always replaced.

#Options

Option Default What it does
Enabled true Switches the system on
Returnable true A card taken out with time left goes back to the inventory. false: it is destroyed
Item 'ghost_sim' Inventory item of the card
Carrier 'GhostNet' Network name shown in Settings, on the item and on the "not authorized" screen
Days 3 How long a new card works once it is in the phone
CheckHours 2 How often expired cards are shut off
Stack 'extend' What a second card does: 'extend', 'replace' or 'refuse'
MaxDays 9 Upper limit when extending
WarnHours 6 Warning before the card runs out. false: none
Apps { 'anon' } Apps that need the card. Any app id works, custom apps too

#Setting it up

  1. Add the ghost_sim item and its image to your inventory: Item setup. On ox_inventory the item needs server = { export = 'fx-phone.useSimCard' }.
  2. Sell the item wherever you like. A new card needs no metadata, so any shop or black market script works.
  3. Put the ids of your illegal apps in Apps.

To hand a card out from a script without the item, use GiveSecondSim; see Server exports: SIM.

#Events

Event Side Arguments When
fx-phone:sim2:changed client sim or nil The GhostNet card was inserted, switched, expired or taken out

sim is { type, slot, line, carrier, enabled, status, active, activatedAt, expiresAt }. active is true only while the card is in, switched on and not expired.

#5. Wisp and the SIM

With Config.Wisp.Registration = true (as shipped) a Wisp account belongs to a number and stays on the phone that set it up, with the SIM in or out. Lending a SIM does not lend the Wisp account; setting Wisp up with that number on another phone (a code is sent to the line) moves it there and signs the first phone out. With false the Wisp account is the phone's primary number and follows its SIM. See Messaging.

#6. Anon

Anon is the app that ships in the Apps list of the GhostNet card. The player picks a handle once; it cannot be changed. What they see depends on who they are:

Part Who sees it
Notices: a board of short announcements Everyone with a working GhostNet card. By default every player with a handle can also write on it (Config.Anon.Notes.Everyone)
Terminal: the crack code game, ranks and XP, and the scan, ping, lookup and trace commands Only players with the hacker permission (Config.Anon.Hacker: the hacker job, the fxphone.hacker ace, or an admin by default)
Rooms: anonymous chats, timed or permanent Everyone with a working GhostNet card, but only with Config.Anon.Rooms.Enabled = true. Off by default

So with the default config a normal player with the card sees only the notices; a hacker also gets the terminal.

Everything is in Config.Anon. The full page, with every command, rank and option, is Anon.

#Typical scenes

Lending your number to a friend. You open Settings > SIM, pick your slot and tap Eject SIM. The card lands in your inventory, named with your number. You hand it over. Your friend uses it and picks a slot: from now on your number rings in their phone, they call and text from it, and they see its Messages chats and call history. If they already had a SIM, they now run two lines and their own stays the primary one. When they give the card back and you put it in, everything is where you left it. Your Wisp account stays on your phone the whole time. With LockToOwner = true this does not work for registered SIMs.

Running two lines. A player buys a second SIM (or an eSIM) at a phone shop and puts it in the free slot. Both numbers now ring. In Settings > SIM > Lines they make one the primary line and set Calls to Ask Every Time. Recents and Messages tag every entry with 1 or 2, the keypad has a line switch, and calling back from Recents uses the line the call came in on.

A burner card changing hands. A dealer sells a ghost_sim. The buyer uses it, picks SIM 2, and Anon opens; the card's three days start now. A day later they take it out: with Returnable = true the card goes back to the inventory with its line id and end date on it. They hand it to someone else, who puts it in and has the same line with about two days left. The time kept running while it was out. When it runs out the line is shut off; taken out then, the card is thrown away.

#Good to know

  • The two systems do not depend on each other. The GhostNet card works with Config.Sim.Enabled = false.
  • Switching Config.Sim off again does not delete anything. Phones keep the number they go by (their primary line); a second line is not used while the system is off.
  • Darkchat is open to everyone by default. Add 'darkchat' to Config.SecondSim.Apps if it should need the card.
  • An app in Apps still has to be installed from the App Store like any other app. The GhostNet card only decides whether it opens.
  • Both item names can be changed in the config. The inventory item must use the same name.
  • For scripts: GetSimLines() on the client lists every number in the phone by slot, and GetSimInfo() returns everything Settings > SIM shows; see Client exports: SIM.