Compatibility
Frameworks and inventories
Which frameworks and inventories FX Pocketbook works with, how it picks one, how characters are named and how its items are registered.
FX Pocketbook runs on RedM with one of two frameworks:
| Framework | Core resource | Inventory |
|---|---|---|
| VORP | vorp_core |
vorp_inventory |
| RSG | rsg-core |
rsg-inventory |
It also needs oxmysql and the second resource fx-pocketbook-assets (pictures and sounds). Other frameworks are not supported.
Start order in server.cfg:
ensure oxmysql
ensure vorp_core # or rsg-core
ensure vorp_inventory # or rsg-inventory
ensure fx-pocketbook-assets
ensure fx-pocketbook
#How the framework is chosen
config.lua:
luaConfig.Framework = 'auto' -- auto | vorp | rsg. If both are started, choose explicitly.
| Value | Result |
|---|---|
'auto' |
vorp when vorp_core is started, rsg when rsg-core is started. When both are started, none is chosen: set it yourself. |
'vorp' |
VORP, if vorp_core is started |
'rsg' |
RSG, if rsg-core is started |
When no framework is chosen, characters do not load and the notebook does not open. The server code (server/framework.lua) and the open adapter file (framework/frameworks.lua) use the same rule, so they always agree.
Run pocketbook_health in the server console to see which framework was chosen and whether its inventory is started.
#Characters
Every character gets an id made of the framework and the character key. Exports, database rows and custom apps use it.
| Framework | Character id | Name | Job and grade |
|---|---|---|---|
| VORP | 'vorp:' .. charIdentifier |
firstname lastname |
job, jobGrade |
| RSG | 'rsg:' .. citizenid |
charinfo.firstname lastname |
job.name, job.grade.level; also job.onduty |
When the player picks another character (vorp:SelectedCharacter, RSGCore:Client:OnPlayerUnload), the notebook closes and waiting notifications are cleared.
#Money
config.lua:
luaConfig.MoneyAccount = 'cash' -- RSG: cash/bank. VORP: cash; bank needs a server adapter.
| Framework | Allowed values |
|---|---|
| VORP | 'cash' only |
| RSG | 'cash' or 'bank' |
After every change the balance is read again. If the new balance is not what it should be, the operation is held for an administrator instead of being tried again. The Bank app's own accounts go through Bank adapters.
#Items
The notebook registers its usable items (pocketbook, the colour notebooks, pocketbook_relay, pocketbook_phonograph, the postal papers and the bird whistle) itself. The back radio items are registered by fx-radio:
| Framework | How |
|---|---|
| VORP | exports.vorp_inventory:registerUsableItem |
| RSG | RSGCore.Functions.CreateUseableItem |
They are registered again when vorp_core, vorp_inventory, rsg-core or rsg-inventory restarts.
Adding the items to the item list:
- VORP: added automatically. On every start the notebook checks its tables; when one is missing or
sql/install.sqlchanged, it runs the file, which inserts its items into theitemstable. Restart the server once afterwards, as the console says, sovorp_inventoryloads them. - RSG: not automatic. Add them to
rsg-core/shared/items.lua. The lines are in the resource'sREADME.md.
Item pictures are in setup/inventoryitem-images/ (200×200 PNG). Copy them to vorp_inventory/html/img/items/ or rsg-inventory/html/images/.
Item metadata (letters, parcels) is written with exports.vorp_inventory:setItemMetadata on VORP and exports['rsg-inventory']:SetItemData on RSG.
#The open adapter file
framework/frameworks.lua is not encrypted (escrow_ignore). It holds the parts you may need to change for your server:
| Table | Connects |
|---|---|
FXFramework |
Framework detection, pocket cash, the short game notice |
FXBank |
The Bank app to your bank script. See Bank adapters. |
FXStables |
The Stables app to your stable script. See Stable adapters. |
FXShop |
The notebook store's money and items. See Store and notices. |
Every amount that goes into or out of FXFramework, FXBank and FXStables is a whole number of cents (100 = 1 dollar). Convert to your script's unit inside the adapter. FXShop uses dollars, like the Fixitfy store scripts.