XyraLScripts
Installation guide

Trucking

A trucking job you build in game. Spots, routes, skills, businesses, convoys and armed jobs.

01

Requirements

Short list:

  • Qbox (qbx_core) or QBCore (qb-core)
  • ox_lib
  • oxmysql
  • ox_target or qb-target

Everything else is found on its own. Keys work with qbx_vehiclekeys, qb-vehiclekeys, qs-vehiclekeys, wasabi_carlock, Renewed-Vehiclekeys, mk_vehiclekeys, cd_garage, okokGarage, t1ger_keys and vehicles_keys. Fuel works with ox_fuel, LegacyFuel, cdn-fuel, ps-fuel and lj-fuel. Police alerts go through XS-Dispatch, ps-dispatch, qs-dispatch, cd_dispatch, core_dispatch, rcore_dispatch or linden_outlawalert, or show up as a blip for police when none of those are running.

No items and no ESX.

02

Installation

  1. Drop the folder into your resources.
  2. Add ensure XS-Trucking after ox_lib, oxmysql and your framework.
  3. Give yourself admin: add_ace group.admin xs.trucking allow.
  4. Restart the server.

The database sets itself up on first start, along with a trucking spot at the Port of Los Santos and a few routes. There is no SQL to import.

03

Admins and commands

Any one of these makes someone an admin:

  • The ace: add_ace group.admin xs.trucking allow
  • A framework group listed in Config.Admin.groups (god and admin by default)
  • Their license in Config.Admin.licenses

Admins get two commands:

  • /truckingbuilder opens the builder for spots and routes.
  • /truckingadmin opens the admin panel.
04

Building spots and routes

A trucking spot is a laptop, truck bays, trailer bays and return bays. Place each one where you stand, then move it until it sits right. Every spot gets the same laptop and the same job.

A route is where the load goes. Give it a name, cargo, trailer type and weight, place the drop points, and set the pay, XP and level. You can also set a certificate, a timer and fragile cargo, and turn on a pickup so the trailer waits somewhere other than the spot.

Quick asks for a name, you place the drop, and it suggests the pay from the distance. A route can belong to one spot or show up at every spot.

05

The laptop

Drivers walk up to the laptop at a spot. Loads are pins on a 3D map: click one to see the pay, distance and what it needs, then take it or start a crew for it.

The truck comes out in a bay and the trailer waits in a trailer bay or at its pickup. Back under the trailer and it hitches on its own. Reverse the trailer into the drop zone and press E. Line it up with the arrow for the Dock Master bonus. Then park in the return bays at any spot to get paid.

The load always comes on its own trailer. Owning a trailer only adds a pay bonus.

06

Trucks and trailers

The depot truck is free and always there. Buying a truck or trailer pays more on every load.

Parts wear as you drive: engine, tyres, brakes, oil and body. Bad tyres lose grip and low oil wears the engine. Fix a part, service everything, or refuel from the laptop. Upgrades cover the engine, gearbox, brakes, suspension and turbo, plus paint, lights, window tint and horns.

Shop trucks and trailers are set in config.lua. Every truck has to be a tractor unit that can pull a trailer.

07

Levels, skills and certificates

There are 50 levels. Every level gives a skill point for the skill tree, which has five paths: long haul, precision, heavy haul, business and smuggling.

Certificates open better loads and come at set levels: reefer, flatbed, car hauler, hazmat and oversize. Levels, skills and certificates are all set in config.lua.

08

Businesses

Any driver can start a business and invite others. Ranks have their own pay cut and permissions, and the owner can change both.

A business has a logo from Imgur or Fivemanage, a bank with deposits and withdrawals, perks, business trucks its members drive, and fleet runs that earn money while nobody is driving. Reputation from every load levels the business up.

Logos show up right away. Admins can see every logo in the admin panel and hide one that is not okay.

09

Co-op

Crews form at the laptop. The lead starts one on a load, others join from the same laptop, and the lead rolls out when everyone is in.

  • Convoys send several trucks on one route. Every truck that delivers close together adds a bonus.
  • Escorts drive a pilot car and are paid for staying close to the trucks.
  • Co-drivers ride in the cab for a cut of the load. Invite one from the laptop or by targeting them.

Which routes allow convoys and escorts is set per route in the builder.

10

Illegal loads and armed guards

Illegal loads pay more. Someone might call it in, and heat builds with every run, making a tip-off more likely.

An illegal route with a pickup can have armed guards. Set how many, their weapons, armour and aim in the builder. They show up around the trailer when someone gets close and shoot anyone who comes near. Hit it solo or bring gunners in your crew. Shots bring the police, and the route rests for a while after each run.

11

The admin panel

/truckingadmin shows every run live on a map, every player's level, XP, certificates and heat, every business and its logo, and the fleet. Settings like pay and XP multipliers change live without a restart, and the logs show every load and every admin action.

12

Troubleshooting

The console says the database could not be set up

Make sure oxmysql starts before Trucking and the database user can create tables. Servers that ran Cipher-Trucking need 3.0.0 or later.

/truckingbuilder does nothing

You are not an admin yet. Add the ace, or put your framework group in Config.Admin.groups.

The truck spawns but will not start

Your keys script was not found. Set Config.Bridges.keys to the one you run.

A load says it is locked

Click it and the button says why: a level, a certificate, too much heat, or a guarded route that is resting.

The guards never show up

Guards need an illegal route with a pickup and Armed guards turned on in the builder. They appear when someone on the run gets close to the pickup.

Police get no alert

Your dispatch script was not found. Set Config.Bridges.dispatch to the one you run.

13

Updating

  1. Back up the database first.
  2. Replace the whole folder, including config.lua. It is new in 3.0.
  3. Restart.

Levels, trucks, trailers and companies from 2.x carry over, and old Cipher-Trucking progress is brought over the first time it starts. No SQL to run.

14

Support

Bugs and questions go to the Discord. Include your server's console output. The script prints the reason when it refuses to do something, and that line is usually the whole answer.

XS-Trucking on GitHub