JCKSDocs
JCKS JobsV2Fonctions

Gigs

Side jobs at gig boards with routes, work steps, crews, contracts, levels and faction links.

A gig is a side job started at a gig board (an NPC or a marker with a blip). It is a route of stops, every stop has work steps with props, tools in hand and animations. Gigs are built in /jobadmin, Gigs. The shared rules are in settings/config.gigs.lua and in Configuration, Gigs.

Permission jobs.gigs opens the Gigs page. Staff without jobs.admin stay inside Config.GigStaffLimits (see Server settings file).

Gig board

The board lists every gig the player can see on the left and the selected gig on the right: what you do, level, pay, contracts, crew and faction. A gig starts only at its own board. Gigs of other boards get a Set waypoint button. /cancelgig (Config.Commands.cancelGig) leaves the running gig.

Step types

Step What the player does
Fell a tree Axe in hand, a swing per hit, the tree falls, logs are carried to the vehicle, a point, or left as items. Spawned tree or a tree already on the map
Metal detector The server hides a point in the stop area. The beep gets faster near it, then dig with a shovel. Finds come from the loot table
Dive and search Scuba gear, oxygen shown in the HUD, refills at the work boat, search spots on the seabed
Build in stages Carry material from the pile, then hammer or drill. The site prop changes after every stage
Rewire a panel Open the box, connect cables by colour, test the circuit
Connect a network Patch ports by label, pull a cable from the rack to the wall socket, test
Fix code Laptop on a desk, build the command from blocks
Carry, place, deliver Props from the stop, a pile, the vehicle or a point to the vehicle, the stop or a point
Collect Pick up scattered pieces by hand
Repair, clean, use item, work Any animation or scenario, any tool, optional minigame. Use item takes the required items
Drive the area Drive the work vehicle inside the stop radius until the time runs out
Device task A task on a jcks_electronics device, with a fallback minigame

Every step sets props (preset or your own model, up to 4 at the stop, placed in game or picked from the world), tool in hand with bone, offset and rotation, animation or scenario, repeats, time, sound, minigame and difficulty, required items and reward items with a chance.

Stops, step points and props are placed with the placement tool: preview, scroll rotates, PgUp and PgDn move up and down.

Templates

New gig offers an empty gig or one of 33 templates. Imported gigs start turned off and only need their places.

Lumberjack, construction worker, electrician, network technician, freelance programmer, metal detectorist, salvage diver, oil field worker, parcel delivery, street cleaning, garbage collection, lawn mowing, quarry miner, fisherman, farm hand, postal worker, bike courier, window cleaner, graffiti removal, house painter, plumber, roofer, gardener, vending machine technician, street light maintenance, warehouse worker, truck delivery, and six device gigs: IT technician, cable installer, cell tower technician, service electrician, server room administrator, camera and alarm installer.

Templates live in shared/gigtemplates.lua. Config.Gigs.templates = false hides the Templates button.

Factions

In Crew and faction a gig can be tied to a job. Each grade has the gig level that unlocks it. After a finished run the player is promoted to the highest grade their level reaches, never demoted. With Hire new players and Config.Gigs.faction.allowHire, players outside the job are hired, multijob rules apply.

Faction job (template) Gigs that promote into it
lumberjack Lumber Company Lumberjack
miner Mining Company Quarry miner
diver Salvage Divers Salvage diver
builder Construction Company Construction worker, House painter, Plumber, Roofer
electrician Water and Power Electrician, Service electrician, Vending machine technician, Street light maintenance
ittech IT Company IT technician, Freelance programmer, Server room administrator
telecom Telecom Operator Network technician, Cable installer, Cell tower technician
cleaner Cleaning Company Street cleaning, Window cleaner, Graffiti removal
garbage Waste Management Garbage collection
oilworker Oil Company Oil field worker
courier Courier Service Parcel delivery, Postal worker, Bike courier
gardener Gardening Company Lawn mowing, Gardener
fisher Fishing Company Fisherman
farmer Farm Farm hand
trucker Logistics Company Truck delivery
dockworker Port of Los Santos Warehouse worker
security Security Company Camera and alarm installer

The link does nothing until a job with that name exists. Create the job from the template of the same name. The metal detectorist links to a detectorist job, which has no job template.

Levels

Gig levels give XP per run. A level can shorten the gig cooldown by a percentage and pay a flat finish bonus, set in the levels sheet of the editor. A cancelled run keeps cancelXpFactor of the XP earned so far.

Crews

With Crew on, 2 to 4 players work together. The leader invites nearby players from the board, the invited player accepts with the request keys. Every member near the board is checked like a solo player.

  • Together on one stop: every swing, plank or dig counts for the same stop. Each on their own stop: every member gets a stop.
  • Pay split: equal, by contribution (work units done) or leader decides (percentages set on the board, 100 % together). A member who did no work gets nothing.
  • Every working member above the first adds crew.bonusPerMember %, at most crew.maxBonus %.
  • The leader can cancel for everyone. A member who cancels only leaves. If the leader disconnects, another member leads.

Contracts

Time limited runs with better pay and XP. The server creates one every contracts.interval minutes from gigs that are on and placed, admins create their own in Gigs, Contracts. A contract has a number of runs and every player finishes it once. Crew contracts need at least 2 members and pay crewPay on top.

What the server checks

Distance to the board, stop, step point, vehicle and the hidden detector point. Travel speed between stops (travelSpeed). The order of steps, every carried piece picked up at the source first, the minimum time of every swing, trip, dig and minigame (timeTolerance), minigame answers, detector signal and finds, item rewards, crew size, who did what, contract runs and expiry. One run never pays a player more than maxPayout. Too fast or too far steps go to the exploit log.

Props of a stop spawn only for players within propDistance and are removed when the stop is done. Tools in hand and carried props are networked only in crew gigs.

Device steps

The step type device hands one part of the work to another resource, usually jcks_electronics. jcks_jobs still checks the stop, distance, order and time.

Field Meaning
task Id of a registered task, for example it_diagnostics
fallbackGame 'none', 'skill', any minigame type or 'custom:<id>'. Used when the task is not registered or its resource is stopped
Template Device task (fallback)
IT technician it_diagnostics (timing)
Cable installer socket_test (timing)
Cell tower technician tower_calibration (skill)
Service electrician charger_repair (timing)
Server room administrator server_backup (timing)
Camera and alarm installer camera_pairing (timing)

Registering a task from your resource (server):

lua
exports.jcks_jobs:RegisterGigStep('it_diagnostics', {
    handler = 'my_resource:GigTask',
    label = { en = 'Laptop diagnostics', sk = 'Diagnostika na notebooku', cs = 'Diagnostika na notebooku' },
    hint = 'Connect the service laptop to the router',
    icon = 'laptop',
    time = 6000,
})

exports('GigTask', function(src, action, data)
    if action == 'start' then
        return { ok = true, hint = 'Open the diagnostics app on your laptop' }
    end
    if action == 'check' then
        return { done = true }
    end
end)

handler is <resource>:<export> and the resource must be the caller. On start, data carries token, task, gig, run, label, coords, radius, difficulty, unit, count. On check it carries token, task, gig, run. When the device task is done, fire the client event jcks_jobs:gigDeviceDone with the token. A task id belongs to the first resource that registers it and is dropped when that resource stops. After a restart of jcks_jobs the server event jcks_jobs:gigStepsReady asks resources to register again.

Options

All keys are under Config.Gigs in settings/config.gigs.lua.

Key Type Default What it changes
enabled boolean true false removes boards and blips, does not register /cancelgig, hides the page for gig staff, refuses gig requests and ends running gigs within 15 s with the deposit refunded
startDistance number 6.0 Metres to the board to open, start or finish
stopTolerance number 6.0 Metres added to every stop radius
vehicleDistance number 7.0 Metres to the gig vehicle for carry and load steps
timeTolerance number 0.75 Share of the shortest step time the server accepts (0.3 to 1.0)
verifySkillSteps boolean true Steps set to the plain skill check are played as the server checked timing minigame. false keeps the skill check, only on steps without item rewards
travelSpeed number 70.0 Fastest travel in m/s the server accepts between two stops, faster arrivals are refused and logged. About 120 for gigs with aircraft, 0 = no check (20 to 300)
propDistance number 150.0 Metres at which stop props spawn (50 to 400)
refundMinEngine number 300 Engine health the vehicle needs for the deposit refund
refundDistance number 40.0 Metres from the board the vehicle must be parked for the refund
cancelXpFactor number 0.5 Share of XP kept on cancel or timeout
platePrefix string 'GIG' Plate prefix of gig vehicles, 4 random digits follow
maxPayout number 25000 Most one player gets from one run, 0 = no cap
templates boolean true Shows the Templates button
crew.enabled boolean true Crew gigs on the server
crew.maxMembers number 4 Most players in a crew (2 to 4)
crew.inviteDistance number 10.0 Metres to the leader for an invite
crew.inviteTimeout number 30 Seconds to accept
crew.startDistance number 25.0 Members further from the board at start are left out
crew.bonusPerMember number 10 % extra pay per working member above the first
crew.maxBonus number 30 Highest crew bonus in %
contracts.enabled boolean true Contracts at all
contracts.auto boolean true Server creates contracts
contracts.interval number 30 Minutes between server contracts
contracts.maxActive number 3 Open contracts at once
contracts.durationMin, durationMax number 45, 90 Minutes a server contract stays open
contracts.payMin, payMax number 1.3, 1.8 Pay multiplier of server contracts
contracts.xp number 1.5 XP multiplier of server contracts
contracts.slotsMin, slotsMax number 1, 3 Runs per server contract
contracts.crewChance number 30 % chance a server contract is for a crew
contracts.crewPay number 0.2 Extra pay on crew contracts
contracts.adminMaxPay number 3.0 Highest pay multiplier staff can set
detect.digRadius number 2.5 Metres to the hidden point to find something
faction.enabled boolean true Faction links of every gig
faction.allowHire boolean true Hire players outside the job when the gig has Hire on

Exports

lua
local level = exports.jcks_jobs:GetGigLevel(identifier, gigId)
local gigId = exports.jcks_jobs:IsOnGig(source)
local contracts = exports.jcks_jobs:GetGigContracts()

IsOnGig returns the gig id or false.