Onyx Phone
A smartphone for FiveM that lives in your character's hand. A 3D phone model shows your live screen to the players around you, you can walk while you use it, and the Camera films the game world from the phone's lens.
Supports Qbox, QBCore and ESX, detected automatically.
Requirements
- FXServer with OneSync enabled
- oxmysql and a MySQL or MariaDB database
- One framework: qbx_core, qb-core or es_extended
- pma-voice for voice and video calls (everything else works without it)
- screencapture or screenshot-basic for taking photos
- ox_inventory or your framework's inventory for the phone item
Install
Step-by-step instructions and every file you need are in the INSTALL folder inside this resource (INSTALL/INSTALL.txt). In short:
- Put the
onyx_phonefolder in your resources. - Add the phone item to your inventory. Ready-made entries are in
INSTALL/2_items: -ox_inventory.txtfor ox_inventory -qb-core.txtfor qb-core -esx.sqlfor ESX - Copy
INSTALL/3_images/onyx_phone.pnginto your inventory's image folder. - Start it after its dependencies in
server.cfg:
ensure oxmysql
ensure qbx_core # or qb-core / es_extended
ensure ox_inventory # if you use it
ensure pma-voice
ensure screencapture # or screenshot-basic
ensure onyx_phone
- Restart the server. The database tables are created on first start.
INSTALL/1_database/install.sqlis included if you'd rather import them yourself.
Players open the phone with F1, the /phone command, or by using the phone item.
Controls
| Where | Key | Action |
|---|---|---|
| Anywhere | F1 or /phone |
Open or close the phone |
| Phone open | Backspace | Go back |
| Camera | Enter | Take a photo or start/stop recording |
| Camera | T | Switch front and back camera |
| Camera | E | Flash |
| Camera | Left / Right | Photo, Portrait, Wide, Video |
| Camera | Z / C | Tilt |
| Camera | Left Alt | Show or hide the mouse cursor |
Players can rebind F1 and Left Alt in the game's Settings > Key Bindings > FiveM.
Configuration
Everything is in config.lua. The settings most servers change:
Config.Brand: the phone's name on screen (defaultONYX). The Drop sharing feature, wallet statements and the valet service follow it.Config.KeyandConfig.Command: how players open the phone.Config.RequireItemandConfig.PhoneItem: whether players need the item, and its name.Config.Calls,Config.RingSeconds,Config.MaxCallMinutes: calling.Config.VideoCalls: video calls. See the privacy note below.Config.VideoRecording: video length, quality and storage per character.Config.Camera: the camera view and photo pose.Config.Flashlight: flashlight range and brightness.Config.Wallet: money transfers between players and the transfer limit.Config.NearbyDistance: how close players must stand to share with Drop.Config.Services: the jobs reached by the Services app (Police, EMS, Mechanic, Taxi by default).Config.Food: the restaurants in the Food Delivery app, their menus and prices, the job names that work there, and the delivery fee. The defaults are examples to rename.Config.Food.Stores: 24/7, LTD and Liquor Store in Food Delivery. They need no staff: a courier drops the order into the player's inventory afterStoreDeliveryMinutes. Each store sells the same items and prices as your existing shop in ox_inventory, qb-shops or esx_shops.Config.DarkChat: how many hours Dark Chat messages are kept.Config.Marketplace: how long listings stay up and how many each player can have.Config.Crypto: the coins on the exchange (name, symbol, starting price, colour, how much each moves per day, supply), the trading fee, the most per order, and alerts. Ten made-up coins are included. A new coin gets 90 days of chart history the first time the server starts, and prices keep moving while the server runs.Config.MediaCleanup: shared videos are deleted after 30 days and photos after 60 by default, so the database stays small. Set either to 0 to keep them forever.Config.MapPlaces: the places offered for GPS routes in Maps.
Store apps
Players add extra apps from the Store on their Home Screen: Dark Chat, Food Delivery, Marketplace, Crypto, Blue Bird and Garage. Blue Bird and Garage come installed and can be removed. Removing an app keeps its data.
Fine-tuning in game
These commands change the camera and flashlight live and print the value to paste into config.lua:
/phonepose: the pose characters take for photos/phoneraise up|down|in|out: how high the phone is held for photos/phoneheight up|down: the back camera's height/phoneview: fill the viewfinder or fit the whole picture/phonegrip: the phone's angle in the hand, for custom phone models/phonelight brighter|dimmer: flashlight brightness
Good to know
- Video call privacy: video calls connect players directly by default, which lets the two players see each other's IP address. To keep IP addresses private, add your own TURN relay server to
Config.VideoCalls.IceServersand setRelayOnly = true. - Photos and videos load over your server's cfx.re HTTPS address, which is fast and needs no setup on most servers. If that isn't available, they fall back to the game connection, which is slower.
- Nearby players see your screen: the phone in your hand shows what's on your screen to players within 25 metres.
- Phone numbers are issued by the phone itself (
Config.NumberPrefix). Numbers, messages and photos are not imported from other phone resources. - Garage reads owned vehicles from
qbx_vehicles,player_vehicles(Qbox/QBCore) orowned_vehicles(ESX). Servers with a custom vehicle table may need to adjustserver/bridge.lua.
Files
client/,server/,config.lua: the resourceweb/: the phone screen.web/index.htmlopens a preview with sample data in a desktop browser.stream/: the 3D phone model
Installation checklist
ONYX PHONE - INSTALL
Requirements: OneSync, oxmysql, one of qbx_core / qb-core / es_extended, pma-voice (for calls), screencapture or screenshot-basic (for photos).
STEP 1 - Resource
Put the onyx_phone folder in your server's resources folder. Do not rename the folder. This INSTALL folder inside it is only for setup and can stay where it is.
STEP 2 - Database (1_database)
Nothing to do: the tables are created automatically the first time the phone starts. If you prefer to create them yourself, import 1_database/install.sql into your database.
STEP 3 - Phone item (2_items)
Open the file for your inventory and follow the steps inside it:
ox_inventory -> 2_items/ox_inventory.txt qb-core -> 2_items/qb-core.txt ESX -> 2_items/esx.sql (run it on your database)
Qbox servers normally use ox_inventory.
STEP 4 - Item image (3_images)
Copy 3_images/onyx_phone.png into your inventory's image folder, e.g.
ox_inventory -> ox_inventory/web/images/ qb-inventory -> qb-inventory/html/images/
STEP 5 - server.cfg
Start the phone after everything it uses:
ensure oxmysql ensure qbx_core # or qb-core / es_extended ensure ox_inventory # if you use it ensure pma-voice ensure screencapture # or screenshot-basic ensure onyx_phone
STEP 6 - Restart and test
Restart the server, give yourself the onyx_phone item, and press F1 (or type /phone) to open it.
Settings, controls and privacy notes are in onyx_phone/README.md.