Trucker JobNew

Trucker Job: Installation

Get the player run trucking business, its tablet and the admin panel running on your server.

v1.0.0Escrow protectedQBox · QBCore · ESX

Before you start

The script talks to your framework, target, fuel and vehicle keys resources through hype-core, which comes with your purchase. Make sure OneSync is enabled and your server artifact is build 7290 or newer.

Requirements

ResourceRequiredNotes
oxmysqlYesBusinesses, employees, fleet, invoices, loans and stats are stored in SQL
ox_libYesCallbacks, locales, notifications, text UI and progress bars
hype-coreYesFramework and module bridge, included with your purchase
qbx_core / qb-core / es_extendedYesOne of them, detected by hype-core
ox_target / qb-targetYesInteraction with the business NPCs, picked by hype-core
Fuel and vehicle keys resourceRecommendedTruck fuel and keys, set with Fuel and VehicleKeys in hype-core's config
esx_licenseESX onlyNeeded for the driver license check on ESX
MugShotBase64OptionalTablet profile photo for players without a Discord avatar

The server needs OneSync, artifact 7290+ and MySQL 8.0+ or MariaDB 10.2+ (the recent activity queries use window functions).

See Dependencies for download links and the start order.

Setup

Download the resource

Get the latest version from portal.cfx.re. hype-core is granted with the same purchase. See Download your purchase.

Keep the folder names

Keep the folders named hype-truckerjob and hype-core. The script calls hype-core by its resource name.

config.lua
fleet.lua
npc-workers.lua
fxmanifest.lua

Database

Run INSTALL/install.sql once in your database (HeidiSQL, phpMyAdmin or the MySQL console). It creates every table the script uses:

TableContent
hype_truckerjob_personelDriver XP, deliveries, earnings, distance and ratings
hype_truckerjob_businessesOwned businesses with name, cash, fleet, blip and rent dates
hype_truckerjob_employeesEmployees with role, commission and custom permissions
hype_truckerjob_istatisticDelivery, earning and distance totals per business
hype_truckerjob_activityDispatch log of every job
hype_truckerjob_npc_workersHired NPC workers, their XP, skills and current job
hype_truckerjob_invoicesRent, NPC wage and loan installment invoices
hype_truckerjob_challengesDaily and weekly challenge progress
hype_truckerjob_loansBusiness loans that are not paid off yet

Do not skip this step

On start, the script only creates the last four tables and adds missing columns on its own. The business, employee and stats tables come from install.sql alone. Without them the console prints Failed to load businesses and nobody can buy a business.

Start the resources

Add them to server.cfg after oxmysql, ox_lib, your framework and your target resource. hype-core must start before hype-truckerjob.

server.cfg
ensure oxmysql
ensure ox_lib
ensure qbx_core          # or qb-core / es_extended
ensure ox_target         # or qb-target

# HypeScripts
ensure hype-core
ensure hype-truckerjob

The language is set with ox_lib's convar, see Locales.

Set the basics

Open config/config.lua and check at least PaymentType, Currency, BusinessLocations, Rent and RequiredDriverLicense. In hype-core's config/config.lua, set Fuel and VehicleKeys to the resources you use. See Configuration for every option.

Spawn points for every business

Only business 1 ships with locations (truck and trailer spawn points). Businesses 2 to 5 can be bought, but their routes are refused with This business has no vehicle spawn location configured until you add locations to them. See Business locations.

Verify

Set Config.Debug = true and start the server. Look for these lines in the console:

[DEBUG] [SUCCESS] Database ready (4 tables, 15 migrations checked)
[DEBUG] [SUCCESS] Loaded 0 business row(s) and 0 employee row(s)

Join the server. Every business shows a Trucker Station blip and an NPC. Target the NPC at business 1 (the docks) and pick Buy the business. The price is taken from your bank.

Target the NPC again and pick Open Trucker Menu. The tablet opens with a guided tour. The business already owns the first truck of Config.Vehicles (a free Mule by default).

Deposit some money into the business, buy a route's truck (and trailer) with business cash, start the route from the Routes page and finish it. The owner keeps a 100% commission, so the pay lands in your PaymentType account, and the job shows up in the Dispatch log. When everything works, set Config.Debug = false again.

How it works

  • Businesses: players buy one of the locations in Config.BusinessLocations from the NPC. The buyer becomes the owner (Boss) and the business gets its own cash, fleet, staff, XP and level. Rent is billed every Rent.intervalDays.
  • Tablet: every page is opened from the business NPC: Dashboard with the company chat, Vehicles shop, Garage, Routes, Dispatch, Employees, NPC Workers, Invoices, Settings and the personal Profile. What an employee sees depends on their role's permissions.
  • Routes: the driver picks a route the business owns the truck (and trailer) for. The vehicles spawn at the business, the driver loads the cargo at the pickup, delivers it and brings the truck back. The pay is split between the driver (their commission) and the business cash.
  • Loading types: hook up a waiting trailer, carry boxes by hand into a box truck, load a flatbed with a forklift, drive cars onto a car carrier, fill a tanker at a marker or load tippers and mixers at a construction site.
  • Rating: each delivery gets 1 to 5 stars from truck and cargo damage, speeding and the time used. High ratings pay a bonus, damage cuts the pay.
  • Fleet: owned trucks track fuel, damage and mileage, trailers damage and mileage. Refuel, repair and sell them in the Garage.
  • Dispatch: a live map of every company truck and a searchable log of all jobs.
  • Employees: hire players standing next to you, give them a role and a commission, override single permissions.
  • NPC workers: hire NPC drivers that run routes on their own. Their jobs are simulated on the server, use the business fleet and can fail.
  • Invoices and loans: rent, NPC wages and loan installments arrive as invoices with due dates. Unpaid rent or loan invoices put the business back on sale.
  • Challenges and stats: daily and weekly challenges with cash and XP rewards, and a personal stats page for every driver.
  • Admin panel: server staff see every business, active routes and recent activity, and can edit, reset or fix them.

Controls and commands

InputWhereAction
Target the NPCBusiness locationBuy the business or Open Trucker Menu
EDuring a routeDeliver cargo, fill the trailer, load boxes or materials, return the truck
GDuring a routeToggle the trailer ramp or the back doors, force place a trailer
BDuring a routeShow or hide the route panel (rebindable in the FiveM key settings)
/cancelrouteDuring a routeCancels the active route, see CancelRoute in the config
/truckeradminAnywhereOpens the admin panel, see AdminMenu in the config

Next steps

On this page