Trucker JobNew

Trucker Job: Configuration

Every option in the config files, from routes, vehicles and delivery ratings to rent, loans, fleet wear, NPC workers, permissions and Discord logs.

v1.0.0Escrow protectedQBox · QBCore · ESX

Tip

After editing, restart only the resource with ensure hype-truckerjob; a full server restart is not needed.

The options are split over five files. config/server/*.lua is loaded on the server only, so webhook URLs and the word list never reach the players.

bad-words.lua
discord.lua
config.lua
fleet.lua
npc-workers.lua

Durations are in the unit named in the option, distances in meters unless noted, damage and fuel in percent (0-100) and money in whole dollars.

General

config/config.lua
Config.Debug = false
Config.NumberAndDateFormat = "en-US"
Config.DateFormat = "DD/MM/YYYY"
Config.Currency = "USD"
Config.SpeedUnit = "kmh"
Config.DistanceUnit = "km"
Config.PaymentType = "bank"

Prop

Type

Experience and levels

Players and businesses both earn XP from every delivery. The level is floor(xp / XPPerLevel) + 1.

config/config.lua
Config.PlayerXPPerLevel = 10000
Config.BusinessXPPerLevel = 30000

Config.ExperienceDetails = {
    enable = true,
    fixed = 50,
    random = { enable = true, min = 10, max = 50 },
}

Prop

Type

Route rules

config/config.lua
Config.CancelRoute = { enable = true, command = "cancelroute", penalty = 0 }
Config.RouteTimeLimit = { enable = true, baseMinutes = 10, minutesPerKm = 2.5 }
Config.RouteAbandon = { failOnDeath = true, maxDistance = 300.0, graceSeconds = 60 }
Config.RouteAntiCheat = { enable = false, maxTravelSpeed = 45.0, pointRadius = 150.0 }

Prop

Type

Pay and rating

The pay of a delivery is the route's totalPay, minus the damage cut, plus the rating bonus. The driver gets their commission of it, the rest goes to the business cash.

config/config.lua
Config.DamagePayCut = { enable = true, truckFactor = 1.0, trailerFactor = 0.5, maxPercent = 50 }

Config.DeliveryRating = {
    enable = true,
    truckDamage = 0.04,
    cargoDamage = 0.05,
    speedLimit = 130,
    overspeedSecondsPerPoint = 45,
    maxSpeedPenalty = 2.0,
    slowAfter = 0.75,
    timePenalty = 1.5,
    randomness = 0.75,
    bonusPercent = { [1] = 0, [2] = 0, [3] = 0, [4] = 5, [5] = 10 },
}

Prop

Type

Challenges

Daily and weekly challenges are picked from a pool. Every player gets the same ones, and the reward (money to PaymentType and player XP) is paid as soon as a goal is reached.

config/config.lua
Config.Challenges = {
    enable = true,
    resetHour = 6,
    daily = {
        count = 3,
        completionBonus = { money = 2500, xp = 100 },
        pool = {
            { id = "d-deliveries-3", type = "deliveries", goal = 3, reward = { money = 1500, xp = 50 } },
            { id = "d-fuel-2", type = "deliveries", deliveryType = "Fuel", goal = 2, reward = { money = 2000, xp = 60 } },
            { id = "d-stars-2", type = "stars", minStars = 4, goal = 2, reward = { money = 2000, xp = 70 } },
            -- ...
        },
    },
    weekly = {
        count = 3,
        completionBonus = { money = 15000, xp = 500 },
        pool = { --[[ ... ]] },
    },
}

Prop

Type

TypeGoal means
deliveriesNumber of deliveries (of deliveryType, if set)
earningsMoney earned from deliveries
distanceKilometers driven on deliveries
starsDeliveries with at least minStars stars
no-damageDeliveries without any damage

The default daily pool has 9 challenges and the weekly pool 8.

Animations

config/config.lua
Config.Effects = {
    animations = {
        boxPickup = { dict = "pickup_object", clip = "pickup_low", duration = 900, flag = 0 },
        boxPutDown = { dict = "pickup_object", clip = "putdown_low", duration = 900, flag = 0 },
        fillTrailer = { scenario = "PROP_HUMAN_PARKING_METER" },
        loadMaterials = { scenario = "WORLD_HUMAN_CLIPBOARD" },
        unload = { scenario = "WORLD_HUMAN_CLIPBOARD" },
    },
}

Each entry is either an animation (dict, clip, duration, flag) or a scenario. Set an entry to false to play no animation for it.

Admin panel

Prop

Type

Rent

Every business pays rent for each period. The invoice appears on the Invoices page dueSoonHours before its due date and can be paid from the business cash or the player's bank.

Prop

Type

Business ownership

What the owner can do from the Settings page of the tablet.

Prop

Type

Loans

The loan money goes into the business cash. It can be spent on vehicles, repairs or workers, but the unpaid part stays locked and cannot be withdrawn. Every intervalDays an installment invoice is issued.

config/config.lua
Config.Loans = {
    enable = true,
    intervalDays = 3,
    closeAfterOverdue = 3,
    maxActiveLoans = 1,
    amounts = { 250000, 500000, 750000, 1000000 },
    plans = {
        { installments = 4,  interest = 5 },
        { installments = 8,  interest = 10 },
        { installments = 12, interest = 15 },
        { installments = 20, interest = 25 },
    },
}

Prop

Type

Driver license

Prop

Type

Business locations

Buyable businesses. Each entry needs an NPC (players open the tablet through it with the target) and spawn points for the route vehicles.

config/config.lua
Config.BusinessLocations = {
    {
        businessId = 1,
        price = 10000,
        ped = {
            enable = true,
            model = `s_m_m_dockwork_01`,
            coords = vec4(1207.43, -3122.66, 4.54, 358.8),
        },
        blip = { show = true, sprite = 477, color = 5, scale = 0.7 },
        locations = {
            truckSpawn = vec4(1196.74, -3100.49, 4.98, 359.86),
            trailerSpawn = vec4(1189.930298, -3102.080566, 5.956488, 358.058289)
        }
    },
    -- businesses 2 to 5
}

Prop

Type

Add spawn points to businesses 2 to 5

Only business 1 ships with locations. The other four can be bought, but starting a route there fails with This business has no vehicle spawn location configured until you add truckSpawn and trailerSpawn. Pick an open spot with enough room for a truck and a trailer.

Delivery types

Types and their colors in the UI. The label must match delivery.type in the routes and deliveryTypes in the vehicles exactly.

config/config.lua
Config.DeliveryTypes = {
    { label = "Standard",     color = "#94a3b8" },
    { label = "Express",      color = "#10b981" },
    { label = "Fragile",      color = "#fb7185" },
    -- Heavy, Refrigerated, Fuel, Chemical, Liquid, Vehicle, Cargo, Box Cargo, Construction, Agricultural
}

Routes

34 routes are included, in Los Santos and Blaine County. Every route starts and ends at the business: the truck spawns at truckSpawn, the cargo is loaded at location.from, delivered at location.to, and the truck is brought back. Routes are not tied to one business; businessName is only the client name shown in the tablet.

config/config.lua
{
    id = 5,
    title = "Box Cargo Transport",
    businessName = "Los Santos Cargo Transport",
    description = "Carry the boxes into the truck by hand and deliver them to the distribution center in Vinewood.",
    delivery = { type = "Box Cargo", amount = "10" },
    location = {
        from = {
            coords = vec4(501.16, -638.62, 23.85, 260.17),
            label = "Warehouse",
            spawn = {
                isObject = true,
                objects = {
                    hash = `hei_prop_heist_box`,
                    amount = 10,
                    coords = vec3(501.16, -638.62, 23.85),
                    rotate = "left",
                    perRow = 4,
                    heading = 260.17,
                    gap = 1.0
                }
            }
        },
        to = { coords = vec4(68.1, 124.19, 78.17, 161.63), label = "Cargo Distribution Center" }
    },
    totalPay = 4800,
    requirements = {
        truck = { name = "Mule III", hash = `mule3`, image = "https://docs.fivem.net/vehicles/mule3.webp" },
    },
    minLevel = 1,
},

Prop

Type

Loading types

The loading type comes from the trailer requirement and the spawn table of location.from. Routes without a trailer must have a spawn type.

TrailerspawnWhat the driver does
NoisTrailer = true, vehicle = { hash, name }Hooks up the trailer waiting at the pickup and delivers it
NoisObject = true, one objects groupCarries boxes by hand into a box truck (Mule, Benson...)
NoisConstruction = trueParks at the marker and loads the truck (tipper, mixer...)
YesnoneParks at the marker and fills the trailer (tanker, box trailer...)
YesisObject = true, forklift and an objects listLoads a flatbed with a forklift, max 4 objects
YesisVehicles = true, vehicles listDrives cars onto a car carrier, max 3 vehicles

For hand loaded boxes, objects is a single group: hash, amount, coords, heading, perRow, gap and rotate ("left" or "right") lay the boxes out in rows. For a flatbed, objects is a list of { hash, coords, rotation } and forklift has a hash, a name and a spawnCoords list (the first free spot is used). For a car carrier, vehicles is a list of { hash, coords }.

Vehicles and trailers

The business shop. The first entry of Config.Vehicles is given to every new business for free.

config/config.lua
Config.Vehicles = {
    {
        id = 1,
        vehicle = { hash = `mule`, name = "Mule", image = "https://docs.fivem.net/vehicles/mule.webp" },
        description = "Compact cargo truck suited for small to medium deliveries.",
        minLevel = 1,
        price = 0,
        stats = {
            deliveryTypes = { "Standard", "Express" },
            capacity = "4,000 kg",
            speed = "125 km/h",
            category = "Box Truck",
        },
    },
    -- ...
}

Prop

Type

Trucks (14)Trailers (11)
Mule, Mule II, Mule III, Benson, Pounder, Rubble, Tip Truck, Tip Truck XL, Mixer, Mixer XL, Phantom, Phantom Custom, Hauler, PackerTanker, Trailer, Flatbed Trailer (two), Car Carrier, TV Trailer, TV Trailer XL, Flatbed Trailer II, Flatbed Trailer III, Log Trailer, TR3 Trailer

Permissions

Tablet permissions per role. The owner can always do everything. Employees use the defaults of their role unless someone gave them custom permissions in the Employees page.

PermissionAllowsDriverSenior DriverManagerBoss
view-dashboardDashboard with stats, recent jobs and chatYesYesYesYes
view-vehiclesVehicle shopYesYesYesYes
view-garageGarage with the vehicle conditionYesYesYesYes
view-routesView and start routesYesYesYesYes
view-dispatchDispatch log and live trackingYesYesYesYes
view-employeesEmployees pageNoYesYesYes
view-npc-workersNPC workers pageNoNoYesYes
view-invoicesInvoices pageNoYesYesYes
deposit-balanceDeposit into the business cashNoNoYesYes
withdraw-balanceWithdraw from the business cashNoNoNoYes
manage-vehiclesBuy, sell, repair and refuel vehiclesNoYesYesYes
manage-settingsChange the business name and blip colorNoYesYesYes
manage-employeesHire and edit lower ranked employeesNoNoYesYes
fire-employeesFire lower ranked employeesNoNoYesYes
manage-npc-workersHire NPC workers and assign jobsNoNoYesYes
pay-invoicesPay invoicesNoNoYesYes
take-loansTake business loansNoNoNoYes
config/config.lua
Config.DefaultPermissions = {
    ["Default"] = { ["view-dashboard"] = false, --[[ every permission false ]] },
    ["Driver"] = { ["view-dashboard"] = true, ["view-vehicles"] = true, --[[ ... ]] },
    ["Senior Driver"] = { --[[ ... ]] },
    ["Manager"] = { --[[ ... ]] },
    ["Boss"] = { --[[ ... ]] },
}

The roles rank Driver, Senior Driver, Manager, Boss. Employees can only hire, edit or fire roles below their own, and Boss is reserved for the owner. Default is the fallback set for a role with no entry.

Fleet

config/fleet.lua controls the condition of owned vehicles. Trucks have fuel, damage and mileage, trailers damage and mileage.

config/fleet.lua
Config.Fleet = {
    minFuelToStart = 10,
    maxDamageToStart = 50,
    refuel = { pricePerPercent = 15, fullTankSeconds = 10 },
    repair = { truckPricePerPercent = 40, trailerPricePerPercent = 25, seconds = 10 },
    wear = { base = 2.0, perThousandKm = 0.8, max = 10.0, trailerMultiplier = 0.5 },
    maxRouteDistanceFactor = 3.0,
    npc = { roadFactor = 1.3, fuelPerKm = 1.5, failDamage = 5.0 },
    resale = { startRate = 0.90, ratePerThousandKm = 0.05, minRate = 0.10, damagePenalty = 0.0 },
}

Prop

Type

With the defaults, a truck bought for $10,000 sells for $8,500 after 1,000 km and $4,000 after 10,000 km.

NPC workers

config/npc-workers.lua. NPC workers are hired with business cash and run routes on their own. A job is simulated on the server: it takes a while depending on the route distance and the worker's speed, then succeeds or fails depending on reliability (and the fragile cargo skill for fragile types). They need a free truck and trailer of the business for the route, like a player does.

config/npc-workers.lua
Config.NPCWorkers = {
    enable = true,
    maxWorkersPerBusiness = 5,
    tickInterval = 15,
    payoutMultiplier = 0.75,
    experienceMultiplier = 0.5,
    minutesPerKm = 1.5,
    minDurationMinutes = 5,
    maxDurationMinutes = 60,
    speedDurationMultiplier = { slowest = 1.6, fastest = 0.6 },
    maxFailChance = 0.35,
    maxFragileFailChance = 0.45,
    fragileDeliveryTypes = { "Fragile", "Chemical", "Refrigerated", "Vehicle" },
    failPenaltyRate = 0.1,
    fireRefundRate = 0.0,
    -- leveling, training, wages, skills, workers
}

Prop

Type

Leveling, training and wages

Prop

Type

Firing a worker, or a worker quitting, deletes it. A re-hired worker starts over with its base skills.

Skills and workers

The skill ids speed, reliability and fragile are used by the simulation; only their label, description and color can be changed. 10 workers are included.

config/npc-workers.lua
workers = {
    {
        id = "john_miller",
        name = "John Miller",
        image = "https://randomuser.me/api/portraits/men/32.jpg",
        age = 41,
        bio = "Twenty years on the interstate. Not the fastest, but his cargo always arrives.",
        level = 1,
        minBusinessLevel = 1,
        hireCost = 7500,
        commissionRate = 15,
        skills = { speed = 45, reliability = 80, fragile = 55 },
    },
    -- ...
},

Prop

Type

Bad word filter

config/server/bad-words.lua blocks business names. Names are checked in lowercase, with Turkish characters turned into plain letters, common leetspeak (0, 1, 3, 4, 5, 7, @, $) undone and letters written one by one joined, so f u c k and f.u.c.k are caught.

Prop

Type

Business names must also be 3 to 50 characters long and cannot contain control characters or <, >, ~ and ^.

Discord logs

config/server/discord.lua. Leave a webhook empty to turn its logs off.

config/server/discord.lua
Config.Discord = {
    enable = false,
    webhook = "",
    username = "Trucker Job",
    avatar = "",
    footer = "hype-truckerjob",
    events = {
        ["business-purchase"] = { enable = true, webhook = "", color = 5763719 },
        ["delivery"]          = { enable = false, webhook = "", color = 3066993 },
        -- ...
    },
}

Prop

Type

EventDefaultEventDefault
business-purchaseOnrole-changeOn
depositOndeliveryOff
withdrawOnchallengeOff
vehicle-purchaseOnadminOn
vehicle-sellOnloanOn
hireOnbusiness-transferOn
fireOnbusiness-closeOn
resignOn

Replace web/dist/logos/your-logo.webp with your server logo. It is shown in the tablet sidebar and the admin panel.

Locales

The language comes from ox_lib, so it is set in server.cfg rather than in the config:

server.cfg
setr ox:locale "en"

en, tr, es, fr, pt, ar, zh, hi and bn are included. If the file for the set language is missing, the tablet falls back to English. To add a language, copy locales/en.json, translate it, save it with the language code as its name (e.g. de.json) and set ox:locale to that code. The same file holds the tablet texts, notifications and Discord log texts.

On this page