Get the Laptop running on your server, with its item and its picture.
On this page
1. The resource
Download tr_laptop from your Cfx.re portal and put it in your resources folder. Start it after tr_core, and before the scripts that put apps on it:
server.cfg
ensure oxmysql# your framework and inventoryensure tr_coreensure tr_laptopensure tr_fraud
The Laptop makes its database tables (tr_laptops, tr_laptop_placed) the first time it starts. Its props (the laptop, its USB plug and cable) stream from its own stream/ folder, so there's nothing else to install for them.
2. The item
For ESX, Qbox, or QBCore running ox_inventory.
Paste the entry from install/ox_inventory/items.lua into ox_inventory/data/items.lua.
Copy install/images/tr_laptop.png to ox_inventory/web/images/.
ox_inventory/data/items.lua
['tr_laptop'] = { label = 'Laptop', weight = 2200, stack = false, close = true, description = 'A well-used laptop. Set it down somewhere to open it.',},
Don't give it a consume, client or server field: using it has to reach your framework, which hands it to the Laptop with its serial number.
For QBCore.
Paste the entry from install/qb-inventory/items.lua into qb-core/shared/items.lua, inside QBShared.Items.
Copy install/images/tr_laptop.png to qb-inventory/html/images/.
qb-core/shared/items.lua
tr_laptop = { name = 'tr_laptop', label = 'Laptop', weight = 2200, type = 'item', image = 'tr_laptop.png', unique = true, useable = true, shouldClose = true, description = 'A well-used laptop. Set it down somewhere to open it.' },
Your inventory reads its items when the server starts, so restart the whole server, not only the resource.
3. Try it
Give yourself a tr_laptop, use it and put it down, then open it with the third eye. It boots into its setup: pick a name and a password, and you're on its desktop. Search in its browser for an app one of your scripts adds.
Before going live
devMode in config.lua lets admins install apps for free and at once. Keep it false on a live server.