QBCore Frameworkqbcore.netCommunity docs
On this page

Updated 2026-09-26 · 4 min read

Create a QBCore side job

Build a complete three-stop delivery resource. The server issues the route, validates the current stop and grants a fixed reward only after completion. The client displays markers and a route blip; it never chooses the reward or supplies coordinates as proof.

Download the delivery example. The archive is generated directly from examples/docs-delivery during the site build. It contains fxmanifest.lua, config.lua, client.lua and server.lua.

Requirements: a working QBCore development server, OneSync enabled for server entity/position checks, a test character and permission to assign jobs. The example uses no inventory, target or vehicle resource. Its logic is source-reviewed and mock-tested, not certified by an in-game test.

QBCore job server validation and payout authority

Conceptual diagram; verify the behavior against your installed resource version.

Define the job

Add an entry inside your existing qb-core/shared/jobs.lua jobs table:

['delivery'] = {
    label = 'Delivery',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = { name = 'Courier', payment = 0 }
    }
},

Zero salary avoids a second automatic paycheck in this task-paid demo. Adjust your economy explicitly rather than silently paying salary and completion rewards together. Reload the affected stack in staging after shared-data changes; refresh alone is not a Lua configuration reload.

Create the resource

Extract the archive so the resource folder is resources/[local]/docs-delivery, not a double-nested folder. Add ensure docs-delivery after qb-core. Use /setjob <your-server-id> delivery 0 through your authorized admin account. The character must be on duty.

config.lua owns the depot, three stops, 3-unit radius, 10-second minimum per stop, 15-minute route lifetime, 60-second between-route cooldown and 200-bank reward. These are example values, not official defaults or economy recommendations. Check the coordinates in your staging map first.

Keep assignment and payouts on the server

The server's session is keyed by connection ID and also stores the issued citizenid. Completion requires the same character, the configured job, on-duty status and routing bucket 0. It validates the expected stop number, server-observed proximity, minimum elapsed time and route expiry.

At the last stop, the server consumes the route before calling AddMoney. It checks the result and does not claim payment succeeded on failure. Repeating a completed request cannot pay it again inside this running process. Requests are throttled before expensive work.

This is not a durable transaction ledger or an anti-cheat. A crash during payment needs separate accounting/reconciliation. Cooldowns are connection-scoped and reset on disconnect; use durable character-level accounting before relying on them as an economic abuse limit. Server-observed proximity alone does not prove legitimate travel; stronger movement checks are a separate concern.

No NPC or vehicle is created by this example, so there is no unexplained client-owned entity to validate. Adding one requires its own ownership/network-ID design.

Add the client interaction

Travel to the depot at 78.7, 111.9, 81.2 and use /delivery. Follow the route blip, wait at least the configured minimum time and press E at the marker. /deliverystop makes the same request for keyboard troubleshooting. /deliverycancel cancels without a reward.

The server sends the next stop; the client replaces its previous blip. Nearby markers draw each frame, while the loop sleeps when no stop is nearby. Character unload and resource stop remove the resource's blip. Server cleanup handles logout, disconnect and incompatible job/duty changes.

Restarting the resource cancels unfinished routes. The example deliberately does not persist partial progress. To add a qb-target depot interaction, call the same start event; do not replace its server checks with client-only conditions.

Test the resource

Staging testExpected result
Wrong job, off duty, far from depot or wrong bucketStart rejected
Start at depot with the assigned jobFirst stop appears
Complete immediately or from the wrong positionNo advancement or payment
Send a future, previous or malformed stop numberNo advancement
Complete three valid stops in orderExactly one fixed bank reward
Repeat the final completion requestNo second payment
Cancel, logout, change character/job or expire the routeOld route cannot pay
Restart during a routeBlip removed; unfinished route forgotten
Fail the mocked AddMoney callNo success message and no automatic replay

The repository's scripts/examples/test-complete-tutorials.lua executes the real server files with mocked core/natives to cover these logic boundaries. That cannot verify map coordinates, entity replication, UI rendering or actual bank persistence; run this matrix in FiveM before deployment.

Sources

Found an issue in this guide?

Send the page URL, the affected example, and a source or reproduction to the site maintainer. For a server or resource problem, use the support guide.

On this page

Leonida RP server website built with RPWebsite
RPWebsite

Advertisement · RPWebsite

Want a website for your server?

Launch a site with live player status, rules, and a join button in minutes.

Build your website