Documentation

Using the Laptop

Take the laptop out, put it down, and keep it running.

Use the laptop item to take the laptop out. It opens in the player's left hand and the OS comes up on its screen. Using the item again puts it away.

Every laptop holds parts that can be bought and swapped, kept in the laptop item. See Hardware & Servicing.

#Keybinds

A panel at the bottom of the screen lists the keys that apply while holding, placing, or standing at a laptop. It hides while the player works on the screen and while the pause menu is up.

ActionKey
Take the laptop out, or put it awayUse the laptop item
Use the held laptopE
Put the held laptop downG
Put the held laptop awayBackspace, X, or right mouse button
Look up from the screenEscape
Look away from the screen, keeping it openF11
Look back at the screenF11 or left mouse button
Stop using the laptop while looking awayBackspace or Escape
Turn the laptop while putting it downScroll wheel, 3° a notch, 30° with Shift held
Place the laptopEnter or left mouse button
Cancel placingBackspace or right mouse button
Use the aimed-at placed laptopE

The port view, service view, screen creator, and shop studio list their own keys. See Commands for the commands.

#Holding the Laptop

The laptop is held flat in the left hand while the right hand types. The player can walk but not sprint, attack, or aim.

Escape closes the screen and leaves the laptop in the hands. E opens it again, G puts it down, and X, Backspace, or the right mouse button puts it away.

A held laptop is put away when the player enters a vehicle, swims, ragdolls, falls, dies, or a cutscene plays. It disappears if its item leaves the inventory, and when the player disconnects.

#Putting It Down

Press G while holding the laptop. A see-through copy follows the aim, turned to face the player, and shows red where the laptop can't stand.

  • Scroll to turn it 3° a notch, or 30° while holding Shift.
  • Press Enter or left-click to place it, or Backspace or right-click to cancel.

It stands on tables, counters, desks, and the floor within placement.maxDistance metres, 2 by default. The surface may tilt up to placement.maxSlope degrees, 12 by default. Floor spots below placement.lowHeight use the low put-down animation, and players kneel to use the laptop there.

placement.clearProps clears map props from around the spot, such as the monitor, keyboard, and mouse already on a police station desk. Only the models in clearProps.models within clearProps.radius metres go, 1 by default. While the spot is picked, the props that will go are outlined. They stay hidden for everyone, through restarts, until the laptop is picked up or the computer removed. clearProps.permission decides who clears them: an ACE permission or ESX group, "command" by default so only staff do, true for everyone, or false for nobody.

#Using a Placed Laptop

A placed laptop has its options on the middle of its keyboard.

OptionWhat it does
Use laptopWalks the player up to it, opens a shut lid, and opens the screen. The player stands at a table or kneels at the floor to type.
PortsOpens the port view. See Ports & Devices.
ServiceOpens the service view. See Hardware & Servicing.
Pick upPuts the laptop back in the inventory and in the player's hands.
Open lid / Close lidOpens or shuts the lid.

With interaction = "point", the default, the options are an interaction point used with E. With interaction = "target", they are listed in the target menu instead, with ox_target or qb-target. Without either, interaction points are used. The options show within use.distance metres, 1.5 by default.

Anyone can use a placed laptop, whoever put it down and whether they are online. The account's password is what keeps it safe. Anyone can pick it up too. placement.ownerOnlyPickUp = true limits it to the laptop's owner, or the character who put it down when it has no owner. See Ownership & Recovery.

ports.others, on by default, lets anyone plug devices in and pull them out. Servicing stays with the character who put it down unless hardware.service.others is on.

#Placed Laptops

A laptop put down leaves the inventory and stays where it stands, in its routing bucket, through disconnects and resource and server restarts, until someone picks it up. The server keeps it in the zyke_laptop_placed table, created on start. Each row holds the serial, the character who put it down, the item's metadata unchanged, the place, bucket, area, and lid.

Picking it up gives the same item back, and the row is only deleted once the item is in the inventory. A full inventory refuses with a notification, and the laptop stays.

A laptop stands in place with no OS running after a server restart. It charges on mains while it stands, the server's downtime included. With standby on, it wakes on its lock screen.

KeyDefaultWhat it does
placement.maxPerCharacter30Laptops one character can have put down at once outside placement areas. false for no limit.
placement.removeAfterDaysfalseRemoves laptops nobody used or opened for that many days, with their item and the devices in their ports. Each removal prints a line to the server console with the serial, owner, place, and item metadata. Computers are never removed.
placement.persistentBuckets{0}Routing buckets laptops stay put down in across restarts.

#Temporary Buckets

Housing scripts hand out instance buckets for apartments and shells and reuse their numbers, so a laptop left in one could stand in a stranger's instance later. A laptop can still be put down in any bucket that is not persistent, and the player is told it is temporary.

It stays only while the character who put it down is in that bucket. Ten seconds after they leave or disconnect, and after a server restart, it leaves the world and its item, metadata unchanged, goes back into their inventory. An offline character gets it at their next login. One with a full inventory is told to make room and gets it once there is. removeAfterDays never removes it meanwhile.

IsLaptopBucketPersistent(bucket) in server/unlocked/hooks.lua decides per bucket instead. Return true for buckets that always mean the same place, such as housing that uses the property id as the bucket. It is asked every two seconds for each placed laptop, so keep it fast.

CanPlaceLaptop(plyId, coords, bucket) in the same file refuses a spot with a locale key, laptopPlaceNotAllowed by default, for example outside a player's own property.

#Placement Areas

placement.areas gives places a limit of their own, such as a server room in an MLO, a warehouse, or a housing interior. Laptops put down in an area count only against that area's limit, never against maxPerCharacter or another area's. The first area that matches is used.

FieldDescription
idUnique text, up to 64 characters.
coords + radiusA sphere.
coords + size + headingA box, size measured along its own axes. heading is optional.
bucketsKeeps the area to these routing buckets. Any bucket when left out. With no shape, the area covers the whole of these buckets.
limitLaptops per character in the area. false or left out for no limit.
lua
areas = {
    {id = "serverroom", coords = vec3(1003.0, -3108.0, -39.0), size = vec3(20.0, 12.0, 6.0), limit = 100},
    {id = "warehouse", coords = vec3(-80.0, -1800.0, 28.0), radius = 25.0, limit = 60},
    {id = "apartments", buckets = {1001, 1002, 1003}, limit = 50},
},

An area that can't be used is left out with a warning in the server console. Laptops stay put down across restarts only in persistentBuckets, so add an area's buckets there too.

For your own rules, such as asking a housing or mining script, replace GetLaptopPlacementArea(plyId, coords, bucket) in server/unlocked/hooks.lua. Return an area id and its limit, or nil for anywhere else. A laptop keeps the area it was put down in until it is picked up.

#Laptop Ids

A placed laptop goes by an id of its own, a negative number, instead of a player's server id. Exports, hooks, and events that take an ownerId mean the holder's server id for a laptop in someone's hands, and the negative id for a placed one. These ids are new each start, so track laptops by serial. See Exports & Events.

#Staying On

A laptop stays on like a real one that sleeps. Closed, put away, set down and left, through a relog or a server restart, it wakes on its lock screen the next time anyone opens it. Once the account's password is given, the desktop has the windows it had, on their workspaces, with the browser's tabs and their history.

It turns off, and boots fresh the next time, when:

  • it is powered off or restarted from the OS,
  • its battery runs out,
  • it is opened up for service, or a script changes its parts,
  • it runs from a USB stick, which leaves with the player who brought it,
  • nobody woke it for standby.days, 30 by default.

The battery drains while the laptop is held and powered on, charges while it is put down, and sleeps without draining in an inventory. A power bank plugged in keeps it charged. See Hardware & Servicing for battery life.

standby.enabled = false turns it off. The resource creates the zyke_laptop_standby table on start, one row per laptop that is on, with its serial, the drive it ran from, the desktop as JSON, and touched_at.

#View & Interface Scale

The OS runs on the laptop's own screen in the world, and the camera zooms onto it as the screen opens, held or put down.

F11 looks away: the camera eases back to the game's view with the screen still open and the player standing still. F11 or a click zooms back in. Backspace or Escape stops using the laptop.

The interface scale, under Settings > Displays, makes everything on the screen bigger or smaller, from 80% to 150%. At a larger scale the OS lays out on a smaller desktop and windows shrink to fit. Automatic, the default, picks the scale from how large the screen appears on the player's monitor, so text stays readable at any game resolution: about 150% at 720p, 125% at 1080p, and 100% at 1440p.

The scale is kept per player on their PC, apart from the OS settings, so it follows them to any laptop.

#The Laptop's Screen

The screen of an open laptop shows nearby players a simple copy of what is on it. It is black while the laptop is off and shows the firmware, boot, and lock screens. On the desktop, it shows the wallpaper, taskbar or dock, and every open window as an outline, with its app's icon and name. The browser shows the site's address and page title.

It never shows the page itself, text the player typed, or anything inside an app. A player's own laptop shows the copy too once they look up from it.

KeyDefaultDescription
mirror.enabledtruefalse turns the copy off.
mirror.range6.0Metres from a laptop its screen is mirrored.
mirror.maxScreens8Laptops one player sees mirrored at once, the nearest in view. Each takes a DUI. At most 8.
mirror.titlestruefalse leaves only the app icons, without window names, page titles, or addresses.
mirror.veilPrivacytrueLeaves out names, titles, and addresses while the laptop runs Veil, even with titles on.

Laptops further away, out of view, or past maxScreens show the lock screen of the OS the watching player runs.

#Desktop Computers

A desktop computer is a business's computer that stays where it is set up: the Zyke One 24, an all-in-one with its keyboard and mouse in front of it. It runs every OS a laptop does and boots, stays on, signs in, and casts like one, from its own drive. It runs on mains, so it has no battery and its parts never wear. It has no lid, skins, finishes, or service view. See Ports & Devices for its ports.

Using the desktop_computer item picks a spot the way a laptop is put down. The computer needs a flat surface with room for its stand and keyboard, and the item leaves the inventory. Its options are on the keyboard: Use computer, Ports, and Remove.

Anyone can use it, and everyone who works there can have their own account on it. See Operating Systems. Only the character who set it up and staff can remove it, which gives the item back with its drive, parts, and ports in the metadata.

KeyDefaultDescription
computer.enabledtruefalse turns computers off. Computers also need the laptop item.
computer.item"desktop_computer"The usable item.
computer.jobsfalseJobs that may set one up, as names or {name = "police", minGrade = 2}. false lets anyone.
computer.maxPerCharacter3Computers one character can have set up at once. false for no limit.
computer.staffPermission"command"ACE permission, or ESX group, of the staff who remove anyone's computer.
computer.prebuilt"desktop"Prebuilt from shared/unlocked/hardware.lua a new computer is built as.

CanPlaceComputer(plyId, coords, bucket) and CanRemoveComputer(plyId, ownerId) in server/unlocked/hooks.lua refuse with a locale key, for example outside the business's property.

Staff with the ACE command.laptop_computer set one up without an item with /laptop_computer [serverId], for themselves or another player, who then owns it. The job, limit, and CanPlaceComputer checks don't apply.

A computer is kept like a placed laptop, in zyke_laptop_placed with kind = "computer", and follows the same bucket rules.

#Skins & Finishes

Players put a skin on the back of the lid in Settings > Appearance, listed by category with a search. Anyone signed in to the laptop can change it, held or put down. Everyone nearby sees it. The skin is kept in the laptop item's metadata as skin, so it goes with the laptop when it is handed over.

By default skins are bought as backplates at the shop, and Settings offers only the stock lid and the skin already on that laptop. See Shop to make them free. CanUseLaptopSkin(plyId, skinId) in server/unlocked/hooks.lua can refuse a skin with a locale key, for example to keep some for donors or a job.

The chassis comes in anodised finishes, set by the shop or another resource with the SetLaptopFinish export. Players don't pick a finish in Settings. A laptop without one is the stock graphite. The finishes on offer are the ids under finishes in shared/unlocked/config.lua. Only those ids work, as the colours are built into the props.

The skins on offer are the ids under skins in shared/unlocked/config.lua, grouped by category and listed in that order. Delete an id to take a skin away; laptops that had it show the stock lid again. A category left without ids is hidden.

#Adding Your Own Skin

  1. Stream a model named zyke_laptop_skin_<id>, modelled in the lid's own space, and register its archetype in a .ytyp loaded with data_file "DLC_ITYP_REQUEST".
  2. Put a <id>.webp thumbnail in nui/skins/, or nui_source/public/skins/ if you build the UI yourself. The tile is 3:2.
  3. Add a "shell:skin:<id>" label to every locales/*.lua file.
  4. Add the id under a category in skins. A new category needs a "shell:skinCategory:<category>" label in every locale file.

#Incapacitated Players

Dead, downed, and cuffed players can't use a laptop. IsPlayerIncapacitated() in client/unlocked/hooks.lua decides it, with zyke_lib's Z.isPlayerDead, the game's own cuffs, and QB's ishandcuffed. It is checked a few times a second while a laptop is held, used, serviced, or its ports are open. A held laptop is put away, and a screen, port view, or service view closes.

The server refuses its own entry points meanwhile, also asking IsPlayerIncapacitated(plyId) in server/unlocked/hooks.lua. Extend both for a death or restraint script zyke_lib doesn't know.

CanUseLaptop(action) in client/unlocked/hooks.lua stops players from using a laptop in other cases, by default while swimming or in a vehicle. See Can-Check Hooks.

#Languages

The laptop ships in 17 languages, one file each in locales/.

LanguageCodeLanguageCode
ArabicarLithuanianlt
ChinesezhPolishpl
CzechcsPortuguesept
DutchnlRomanianro
EnglishenSpanishes
FrenchfrSwedishsv
GermandeThaith
ItalianitTurkishtr
Japaneseja

The language comes from zyke_lib: set language in its config to one of these codes, and every Zyke resource follows it. A code without a file falls back to English. The whole OS follows it, including notifications and the sites built into the laptop. The language a player picks in an OS's setup is part of the roleplay and doesn't change the text.

To change a text, edit its key in your language's locale file. To add a language, copy locales/en.lua to a file named after its code and translate the values.

#Without a Laptop Item

With item = false, there is no usable item. Each character has one laptop, opened through the TakeOut export from your own resource. Its parts and ports are kept in the server's KVP by its serial, and its skin on the player's PC.

  • It is put down the same way, but only that character can pick it up, and it can't be taken out while it stands somewhere.
  • Left in a temporary bucket, it is free to take out again once it goes.
  • It is always the character's own. See Ownership & Recovery.
  • Desktop computers are off, and the shop sells no laptops, finishes, or backplates.