Installation
Requirements
| Resource | |
|---|---|
| Required | oxmysql |
| Required (one) | qbx_core, qb-core or es_extended (ESX Legacy) |
| Optional voice | pma-voice, saltychat or yaca-voice. Without one, calls are UI-only |
| Optional | ox_inventory (phone item, gated apps) |
| Optional | screenshot-basic (camera) |
Node 18+ to build the NUI once.
Steps
- Put the resource in your
resourcesfolder asnp_phone. - Build the NUI:sh
cd web && npm ci && npm run build - Start it after its dependencies:cfg
ensure oxmysql ensure qbx_core # or qb-core / es_extended ensure pma-voice # optional: or saltychat / yaca-voice ensure ox_inventory # optional ensure screenshot-basic # optional: camera ensure np_phone - Database: the tables are created automatically on first start (
CREATE TABLE IF NOT EXISTS, all prefixedphone_). Thesql/*.sqlfiles are reference copies only. - Phone item (only with
Config.RequireItem = true): add aphoneitem to your inventory, in ox_inventorydata/items.lua, qbshared/items.lua, or the ESXitemstable. - Camera: start
screenshot-basicand set an upload key (see below). - Darkchat needs a
vpnitem (Config.StoreApps). - Admins (optional): let them delete other players' Chirps and ads:cfg
add_ace group.admin np_phone.admin allow
Secrets in server.cfg
Never write secrets into the config files. Use set, not setr, so they aren't sent to clients:
cfg
set np_phone:upload_provider "fivemanage" # or "discord" / "none"
set np_phone:fivemanage_token "your-api-key"
set np_phone:discord_webhook "https://discord.com/api/webhooks/..."
set np_phone:passcode_pepper "long-random-string" # extra secret mixed into passcode hashesFiveManage is the recommended upload provider
The API key stays on the server. The server hands the client a short-lived presigned URL instead. Discord webhooks can't be presigned, so client uploads to Discord are disabled unless you opt in. See Media → Upload security.
Opening the phone
F1 by default (Config.OpenKey), or the /phone command (Config.Command). Players can rebind the key under Settings → Key Bindings → FiveM.
Troubleshooting
| Symptom | Fix |
|---|---|
| Blank phone | web/dist is missing. Build the NUI |
| "You don't have a phone." | Config.RequireItem = true and the player has none of Config.ItemNames |
| Calls connect but there's no audio | No voice bridge loaded. Start the voice resource before np_phone, or check Config.Voice |
| pma-voice calls cross with other scripts' calls | Change Config.VoiceCallChannelOffset to a range nothing else uses |
Camera shows screenshot_basic_missing | Start screenshot-basic |
Camera shows upload_not_configured | Set np_phone:fivemanage_token, or pick another provider |
Images are rejected (invalid_url) | The host isn't in Config.Media.allowedHosts |