Integration
Adapters
FX Phone adapters that exist in other resources, and the config value to set in each.
This page lists resources that have an FX Phone adapter next to their existing lb-phone or cylex_phone integration. The adapters are additive: the lb-phone and cylex_phone paths are untouched, and FX Phone is checked first wherever a resource auto-detects the phone.
FX Phone fires cylex_phone:client:phoneLoaded, cylex_phone:customApp:opened, cylex_phone:customApp:closed and lb-phone:phoneToggled alongside its own events. Where a resource's existing handlers already do the right thing on those events, its FX Phone adapter does not bind the same thing again.
Whether a given build of a third-party resource already contains its adapter depends on that resource's version. Check its files or ask its author.
#Fixitfy resources
| Resource | File | Purpose |
|---|---|---|
| fx-musicapp | client/phone/fxphone.lua |
App, messages, notification with cover, Music Tray, input focus, reload hooks |
| fx-mapsapp | client/phone/fxphone.lua |
App, messages, notification, input focus, reload, open and close hooks |
| fx-metubeapp | client/phone/fxphone.lua |
App, messages, notification, input focus, open and close hooks |
| fx-garageapp | client/phone/fxphone.lua |
App, messages, notification, input focus, open and close hooks |
| fx-casinoapps | client/phones/fxphone.lua |
App, messages, input focus, remove, open and close lifecycle |
| fx-companyapp | client/phone/fxphone.lua, server/phone.lua |
App, messages, notification, input focus, dialling through CreateCall, in-call state from the fxphone_call state bag; on the server: notification, number, SMS and bank history entries |
| fx-foodjobs | client/phone.lua, bridge/phone.lua, bridge/billing.lua |
App, message, notify, dial, focus; phone number lookup; bills as FX Phone invoices with the business label and job |
| fx-motels | client/phone/fxphone.lua, server/bridge.lua |
App, messages, notification, input focus; owner mail through SendMail |
| fx-tattoos | bridge/phone.lua |
Mail through SendMail by identifier, by number as a fallback |
| fx-base | shared/phone.lua |
Finds the fx_phone_users table; renames through SetUserData, wipes through WipeUser |
#Third-party resources
Only the editable files of these resources are involved.
| Resource | File | Purpose |
|---|---|---|
| cylex_mdt | editable/framework/phone/fx-phone.lua |
Phone numbers by identifier (GetNumberFromIdentifier, works offline) |
| cylex_mdt | editable/framework/billing/fx-phone.lua |
Fines as FX Phone invoices (AddInvoice, split by Config.Invoices.Jobs) |
| cylex_emsmdt | editable/framework/phone/fx-phone.lua |
Phone numbers by identifier |
| prp-bridge | modules/phone/fx-phone/server.lua, client.lua |
SMS, location and notification through FX Phone |
| tgiann-phone-accessories | client/editable.lua, server/editable.lua |
Accessory visibility from fx-phone:phoneToggled; closes with ToggleOpen(false); the studio shows the number and name |
| tgiann-bank | server/editable.lua |
Transfer friends from FX Phone contacts |
#Config values to set
| Resource | Setting | Value |
|---|---|---|
| fx-musicapp, fx-mapsapp, fx-metubeapp, fx-garageapp, fx-companyapp | Config.Phone.Resource |
'auto' (FX Phone wins) or 'fx-phone' |
| fx-casinoapps | Config.Phone |
'auto' or 'fx-phone' |
| fx-foodjobs | Config.PhoneApp.phone, Config.Billing.provider |
'auto' or 'fx-phone' |
| fx-motels | config.phoneApp.resource |
'auto' or 'fx-phone'; config.phoneMail = true for owner mail |
| fx-tattoos | Config.Bridge.Phone |
"auto" or "fx-phone" |
| fx-base | The table setting in config_phone.lua |
'auto' |
| cylex_mdt, cylex_emsmdt | Config.Phone |
'fx-phone' or 'auto' |
| cylex_mdt | Config.Billing.script |
'fx-phone'. The payment split is FX Phone's Config.Invoices.Jobs[job] |
| prp-bridge | BridgeConfig.Phone |
"fx-phone" |
| tgiann-phone-accessories, tgiann-bank | None | Detected automatically |
#Scripts that trigger cylex events
Scripts that trigger cylex_phone:client:openPhone (for example an ambulance job closing the phone on death) need no change. FX Phone answers that event itself while cylex_phone is not running.
#Writing your own adapter
A script that supports another phone usually needs four things from FX Phone:
| Need | Use |
|---|---|
| Register an app | Custom app exports |
| Send a notification | Notification exports |
| Read a phone number | User exports |
| Send a message, mail or invoice | Message exports, Invoice exports |
Scripts that cannot be edited can use the shim resources instead: lb-phone compatibility and cylex_phone compatibility.