Hooks
Run your own server code when a player finishes a bus route.
Advanced Bus Job has no exports. It has one hook in gg_busjob/base/core/open/server.lua, which ships open so you can edit it.
When a route is completed
Lua
hooks.jobCompleted = function(payload)
gg.miniBridge.challenge({source = payload.source, challenge_id = "gg_busjob_complete_route", count = 1})
end
Runs on the server each time a player finishes a route, after they are paid. By default it counts the route toward the Coin Shop challenge gg_busjob_complete_route when gg_coinshop is started, and does nothing otherwise.
| Field | Type | Meaning |
|---|---|---|
payload.source | number | The driver's server id |
payload.identifier | string | The driver's character identifier |
payload.job_id | number | The route's position in cfg.routeData |
payload.reward | boolean | true once the route pay and XP were given |
payload.completed_stops | number | Stops completed |
payload.total_stops | number | Stops on the route |
payload.timestamp | number | os.time() when the route finished |
Add your own code below the Coin Shop line, for example to log routes or give an extra reward. An update replaces this file, so keep a copy of your changes.
