Trucker Job: Exports & Events
Commands, the keybind, the player load events the Trucker Job listens to and the hype-core bridges it relies on.
No exports in v1.0.0
hype-truckerjob does not register any exports of its own yet. Everything runs through the tablet, the admin panel and the commands below. Integration with your framework, target, fuel and vehicle keys goes through hype-core.
| Name | Type | Side | Purpose |
|---|---|---|---|
/cancelroute | Command | Client | Cancels the active route |
/truckeradmin | Command | Server | Opens the admin panel |
+toggleinfopanel | Keybind | Client | Shows or hides the route panel (B) |
hype-core:server:player-loaded | Event | Server | Loads a character's driver data and businesses |
hype-core:client:player-loaded | Event | Client | Refreshes the tablet data, NPCs and blips |
Commands
/cancelroute
Cancels the player's active route after a confirmation dialog. There is no pay, the job counts as failed, the route
vehicles are removed and CancelRoute.penalty is taken from the business cash. The tablet has the same button.
/cancelrouteThe name comes from Config.CancelRoute.command. Set it to false to keep only the tablet button, or set
CancelRoute.enable = false to turn cancelling off.
/truckeradmin
Opens the admin panel. Players run it in chat or the F8 console; the server console is ignored.
/truckeradminThe name comes from Config.AdminMenu.command; false registers no command. From the panel, staff can:
| Action | What it does |
|---|---|
| Mark rent as paid | Closes every unpaid invoice of a business |
| Extend rent | Moves the next rent date by 1 to 365 days |
| Set cash | Sets the business cash to an exact amount |
| Edit business | Changes the name and the full blip (sprite, color and scale) |
| Reset business | Removes the owner and puts the business back on sale |
| Fire employee | Removes an employee from a business |
| Cancel route | Fails a player's active route |
| Teleport | Moves the admin to a point picked on the panel map |
Every action is printed to the server console and, with Config.Discord, sent to the admin log.
+toggleinfopanel
Shows or hides the on screen route panel while a route is active. It is a key mapping with B as the default, so
every player can change it in Settings → Key Bindings → FiveM under Toggle Trucker Job Info Panel.
Events
The script uses hype-core's player load events to know when a character is ready. The framework bridges in hype-core trigger them from the QBox, QBCore and ESX load events, so nothing is needed in most cases.
hype-core:server:player-loaded
Loads the character's driver XP (and creates their hype_truckerjob_personel row), marks them online in every
business they work for and refreshes the employee lists. Trigger it yourself if your multicharacter resource loads
characters without the usual framework events.
TriggerEvent('hype-core:server:player-loaded', source)Prop
Type
hype-core:client:player-loaded
On the client, the script sends the player data, config and translations to the tablet again and rebuilds the business NPCs, blips and target options.
TriggerEvent('hype-core:client:player-loaded')Internal events
Events named hype-truckerjob:server:* and hype-truckerjob:client:* are internal. The server checks every route
step, position and payment, so triggering them by hand does nothing useful and can fail an active route.
hype-core bridges
hype-truckerjob calls nothing from your framework directly. Every outside call goes through hype-core, so a change in your setup is made once in hype-core for every HypeScripts resource.
| Need | hype-core call | Configured by |
|---|---|---|
| Character id and name | GetPlayerIdentifier, GetCharacterName, GetPlayers | Framework, detected automatically |
| Money | GetPlayerMoney, AddPlayerMoney, RemovePlayerMoney | Framework |
| Driver license | GetPlayerLicense | Framework, esx_license on ESX |
| Dead check | GetIsPlayerDead | Framework |
| NPC interaction | GetModules("Target") | ox_target, or qb-target when ox_target is missing |
| Truck fuel | GetFuel, SetFuel | Fuel in hype-core's config |
| Vehicle keys | GiveKeys, RemoveKeys | VehicleKeys in hype-core's config |
| Blips and NPCs | CreateBlip, UpdateBlip, RemoveBlip, CreateFreezedPed, RemovePed | - |
| Profile photo | GetDiscordAvatar | Discord bot settings of hype-core |
Notifications, text UI, progress bars and dialogs use ox_lib directly. When a player has no Discord avatar and
MugShotBase64 is running, a headshot of their ped is used as the tablet profile photo.
Fuel = 'ox_fuel',
VehicleKeys = 'qbx_vehiclekeys',