LaptopInstallation

Installation

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 inventory
ensure tr_core
ensure tr_laptop
ensure 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.

  1. Paste the entry from install/ox_inventory/items.lua into ox_inventory/data/items.lua.
  2. 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.

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.
  • Who may use it, and where: see Your server's rules.
Was this page helpful?

Still stuck? Open a ticket on Discord.Privacy