Skip to content

Installation ​

Download ​

sd-computers is free on GitHub. There are two ways to get it. Pick one; if you are not sure, use the Release.

This is what almost everyone should use: the resource with its interface already built, nothing to compile.

  1. Go to the latest release.
  2. Under Assets, download sd-computers.zip.
  3. Unzip it. You get a folder called sd-computers: drop it into your server's resources, and continue with Dependencies below.

Download sd-computers.zip, NOT "Source code (zip)"

Every release also lists Source code (zip) and Source code (tar.gz), and the repository has a green Code button. Those are the source: they do not include the built interface (web/build), and a computer opens to a blank screen until you build it. Only download the asset named sd-computers.zip, unless you mean to build it yourself.

Building from source (only to change the code) ​

A git clone or a source ZIP is the raw project, without web/build. Build it once:

  1. Install Node.js (the LTS version).
  2. A source ZIP unpacks to sd-computers-main: rename it to sd-computers, the name its exports are called by.
  3. Open a terminal in the resource's web folder and run:
sh
npm install
npm run build
  1. When it prints built in ..., the new web/build folder is the interface. Drop the whole sd-computers folder into your resources.

Changed the code later? Rebuild.

The game loads web/build, not the source. Run npm run build again after every change to the interface. See Building from source in the README for the browser preview and the rest.

A computer opens to a blank or black screen?

web/build is missing: the Source code ZIP was used, or the build was skipped. Build it as above, or download sd-computers.zip from the release instead.

Dependencies ​

ResourceWhat it is for
ox_libShared library
oxmysqlDatabase access
A target resourceox_target, qb-target or qtarget, for the "Use Computer" option

Optional: sd-banking or Renewed-Banking for the Business Manager's society funds, and sd-phone v1.0.7 or newer to make each computer another screen for the phone (see sd-phone Link).

The framework (QBox, QBCore or ESX) and the inventory are detected on their own.

1 Start the Resource ​

Start it after ox_lib, oxmysql, your framework, your target and your banking:

cfg
ensure ox_lib
ensure oxmysql
ensure sd-computers

The database tables create themselves on first boot: computers_profiles, computers_logs, computers_placed, computers_settings, computers_mail_accounts, computers_mail_sessions, computers_mail_messages, computers_files, computers_photos, computers_board, computers_cameras, computers_printers, computers_prints, computers_signatures and computers_phone_links. There is no SQL file to import.

2 Add the Printout Item ​

A page taken from a printer is an inventory item, so your inventory has to know it. Its name is Item in configs/shared/printers.lua (printed_document by default). No printers on your server? Skip this step, or set Enabled = false in that file.

lua
-- ox_inventory/data/items.lua
['printed_document'] = {
    label = 'Printed page',
    weight = 5,
    stack = true,
    close = true,
    consume = 0,
    description = 'A page from a printer.',
    server = { export = 'sd-computers.usePrinted_document' },
},
lua
-- qb-core/shared/items.lua
printed_document = { name = 'printed_document', label = 'Printed page', weight = 5, type = 'item', image = 'printed_document.png', unique = true, useable = true, shouldClose = true, description = 'A page from a printer.' },

On ox_inventory, copies of the same page stack (each page is told apart by its metadata). If you rename the item, the export's name follows it: use and the item name with its first letter in capitals (sd-computers.usePrinted_document). On any other inventory (qb-inventory, qs-inventory, tgiann-inventory, codem-inventory, origen_inventory, jaksam_inventory, one_inventory) add an item of that name the way your inventory adds items, usable and not stackable: sd-computers registers it as usable by itself.

Until the item exists, the Printers tab of the admin panel says so, and so does the server console at boot.

3 Add the Item Image ​

Copy docs/items/printed_document.png from the resource into your inventory's image folder (e.g. ox_inventory/web/images/), or download it here.

Computers Item Images1 images
Printed page
printed_document.png

4 Set Up Your Computers ​

Computers come from two places, and you can use both:

  • In game, with /computeradmin: place a computer on any desk, or turn a monitor the game already has into one, and it is live at once. See Admin Panel.
  • In the config, configs/shared/computers.lua: each entry is a location (a box zone at fixed coordinates) or a model (every prop of that model in the world). See Configuration > Computers.

Monitors around the map are not computers out of the box

The model computers are off until you switch them on: out of the box, only the locations in computers.lua and the computers you place or pick are computers. To make every prop of the listed models a computer, flip the switch at the top of the panel's Automatic tab, or set Automatic = true in configs/shared/admin.lua.

The example locations (MRPD front desk, Pillbox reception) are from qbx_police and qbx_ambulancejob; check them in game. With Debug = true in configs/config.lua, aim at a monitor and run /computer_pos: it copies a ready-made coords = vec3(...) line.

5 Breach Targets and PINs ​

Both live in configs/server/, which never ships to clients:

  • targets.lua: what Command Prompt can breach, and the rewards. See Hacking & Breach Targets.
  • security.lua: optional PINs per computer. None is set out of the box: a computer's groups already decides who may use it, and only they are offered it.

6 Admin Permissions ​

/computeradmin uses aces. Group in configs/shared/admin.lua (default group.admin) gets the command and the edit ace sd_computers.edit. To let another principal edit:

cfg
add_ace group.mod command.computeradmin allow
add_ace group.mod sd_computers.edit allow

To let them look without changing anything, set ViewGroup = 'group.mod' instead. See Admin Panel > Permissions.

Next Steps ​