NX CreativeNX CreativeDocs
Scriptsnx_phone

Phone

A smartphone for your city. 34 apps, phone numbers that live on SIM card items, calls, messages, video calls, an SDK for your own apps, and a server API for other resources. Runs on ESX, QBCore, QBox, and standalone.

nx_phone is a smartphone players carry as an inventory item. The phone number lives on a separate SIM card item, so a handset, a number and the person holding them are three different things. Swap the SIM and the phone takes the other number. Drop the phone and someone else can pick it up, but they still need the passcode.

The phone docks in the corner of the screen and players can move and resize it. Other players see it in your hand, and anyone standing close enough can read the screen unless you fit a privacy screen.

Features

  • 34 apps. Phone, Messages, Contacts, FaceTime, Camera, Photos, Maps, Wallet, Notes, Clock, Weather, Calculator, Exchange, Recorder, Browser, Waveform (music), Mail, Beacon (Find My), Garage, Home, Shift (jobs), Companies, Airwave (radio), Depot (the app store), Yapp, Ember, Cipher, Bulletin, Stall, Trace, Gloss, Glimpse, Flick, and Settings. You can switch apps off one by one in config.lua.
  • Numbers on SIM cards. Every number is a SIM item with its own carrier. A new SIM gets a number in your Config.Sim.NumberFormat the first time it is used. Suspended numbers go back into the pool after Config.Sim.ReclaimDays. A character's first SIM of their own becomes their main number, and a carrier counter sells new SIMs and replacements that keep the main number.
  • Calls. Voice calls over pma-voice with speakerphone, voicemail with custom greetings, call screening for unknown callers, and service lines such as 911 that ring every on-duty player in the listed jobs. Emergency lines work without a SIM and without unlocking the phone.
  • Companies. A directory of the city's businesses. Players see which are open, then call, text or set a GPS route to one. Calls ring the employees on duty, and texts land in a shared company inbox where staff reply as the company.
  • Messages. One-to-one and group threads, photo attachments, delivery and read receipts, reactions, typing indicators and search.
  • FaceTime. Video calls between up to four phones.
  • Lock screen and accounts. A passcode, Face ID for the phone's owner, and up to Config.MaxAccountsPerCharacter accounts per phone. Players can set one wallpaper for the lock screen and another for the home screen, or keep them as a pair. The social apps and Mail follow the account that is active on the handset.
  • Lose it, find it. A downed player can drop their phone. Phones on the ground ring and can be picked up. Beacon finds a lost phone, puts it in Lost Mode, or erases it.
  • A screen people can read. Bystanders see a live picture of your screen. Put the phone on a table and it shows StandBy. The privacy screen item darkens it for anyone not looking straight on.
  • Live Activities. Other resources can show a delivery or a countdown in the phone's island and on its lock screen.
  • Tap to Pay. A business takes card payments on its phone and the customer confirms on theirs. Needs nx_realbanking.
  • Company cards. Players who may use a company's bank account see it in Wallet, and those allowed to make transfers can send from it. Needs nx_realbanking 1.11.0 or later.
  • Payphones. Real payphone props in the map work as phones, each with its own number that people can call back.
  • Script adapters. Garage, Home, Shift and Airwave pick up popular garage, housing, dispatch, banking and voice scripts by themselves. The adapters live in bridge/ and stay readable so you can fit them to a forked core.
  • An SDK and a server API. Other resources can add their own apps, answer phone numbers, send texts, mint SIMs, and close or disable a player's phone. See Exports and SDK.

Works with nx_computer

When nx_computer runs on the same server, the phone and the laptop share accounts and mail addresses. Bulletin shows the laptop's Newsroom, Stall shows its classifieds board, Exchange shows its market prices, Beacon lists the character's laptops, and the MDT gains phone tools. With Config.DependOnComputer = 'auto' (the default) this turns on by itself when both resources are started.

Network use

The phone talks to outside services only for features you set up:

  • Fivemanage, once you add your API key in config_server.lua: photos, videos, voicemail, greetings and voice memos.
  • A STUN server (Google's by default) to connect FaceTime calls. Add your own TURN server in config_server.lua to keep players' IP addresses private.
  • Discord webhooks, if you set them in config_server.lua.
  • Music links that players add, limited to Config.Music.AllowedHosts when you fill it in, and Browser images from Config.Browser.ImageHosts.

Framework support

Config.Framework = 'auto' detects ESX, QBCore and QBox. Set it explicitly if detection picks the wrong one. ox_inventory holds the phone and SIM items on every framework.

Where to go next

  • Installation: dependencies, items, start order and media storage.
  • Configuration: every option in config.lua and config_server.lua.
  • Exports: the server and client API.
  • SDK: add your own app to the phone.

Get it

Available at nxcreative.tech/phone.

NX Docs