Configuration
Everything lives in config.lua (editable in both the open and encrypted version). Framework, inventory, target and notification selection is handled by vns-core; this page covers the job itself.
Job behaviour
| Option | Default | What it does |
|---|---|---|
Config.RequireJob |
false |
Restrict the job to players with a specific framework job. |
Config.JobName |
'newspaperjob' |
The job name checked when RequireJob is true. |
Config.PayOnReturn |
true |
true: all deliveries are paid in one cash sum when the vehicle is returned, and the rental fee applies. false: each delivery pays out in cash immediately and no rental fee is charged. |
Config.VehicleFee |
100 |
Rental deposit taken from the player's bank when starting (only with PayOnReturn = true). Players without enough bank money cannot start. Refunded in full when they finish the job. Set to 0 for no fee. |
Bonus item
Config.BonusItem = {
item = "mysterious_envelope",
chance = 1 -- out of 1000
}
When a player finishes the job with every drop on the route delivered, the script rolls chance out of 1000 once: chance = 1 (default) is a 1 in 1000 chance, chance = 10 is 1%, chance = 1000 guarantees the bonus. Values above 1000 count as 1000. Set chance = 0 to disable the bonus. The item must exist in your inventory.
Blips
Config.Blips controls the two blip types: startJob (the permanent blips on the start peds) and deliveryLocation (the temporary blips on each drop of an active route). Each entry takes label, sprite, color and scale.
Routes
Config.Routes is a list of start locations. Each one has its own ped, vehicle and route pool:
Config.Routes = {
[1] = {
start = {
coords = vec4(375.5, -368.64, 45.83, 150.42), -- ped position + heading
pedModel = 'csb_customer',
},
vehicle = {
model = "bmx",
spawnCoords = vec4(368.2910, -374.1460, 46.4329, 214.6424),
},
routes = {
['Restaurants Route'] = {
reward = {min = 150, max = 300}, -- random payment per drop
route = {
[1] = vec3(99.4583, -1418.8939, 29.4216),
[2] = vec3(90.0274, -1411.2307, 29.4207),
-- ...as many drops as you like
}
},
-- more routes...
},
},
}
- When a player starts at a ped, one route from that ped's pool is picked at random. Players cannot choose.
- The number of drops decides how many newspapers they get (drops x 2).
rewardis rolled per delivered drop, in both payment modes.vehicle.modelcan be any vehicle: bicycle, car, van. Fuel is set to full on spawn.- The default config ships two start locations with three routes each.
Add as many start locations and routes as you want by copying the pattern above.
Notifications and language
Config.Lang contains every player-facing text:
Config.Lang.Target- the two target labels (start_job,finish_job).Config.Lang.Notifications- every notification, each withtitle,desc,type(success/error/warning/inform) anddurationin ms.
Some descriptions contain %s / %d placeholders (route name, drop counts, amounts). Keep the placeholders when translating, in the same order.
Notifications are shown through vns-core, so where they appear follows Config.NotifySystem in vns-core/config.lua.
Open bridge files
| File | Function | Purpose |
|---|---|---|
client/client_open.lua |
Bridge.Notify |
Shows a notification through vns-core |
client/client_open.lua |
Bridge.HasJob |
Client-side job check for Config.RequireJob |
client/client_open.lua |
Bridge.AddTargetEntity / Bridge.RemoveTargetEntity |
Target options on the start ped |
client/client_open.lua |
Bridge.OnJobVehicleSpawned(vehicle, plate) |
Empty hook for vehicle keys, fuel scripts, etc. |
server/server_open.lua |
Bridge.GetPlayerIdentifier, Bridge.HasJob |
Identity and server-side job check |
server/server_open.lua |
Bridge.GetMoney / AddMoney / RemoveMoney |
Rental fee (bank) and payments (cash) |
server/server_open.lua |
Bridge.AddItem / RemoveItem / GetItemCount / CanCarryItem |
Newspapers and bonus item |
server/server_open.lua |
Bridge.Notify |
Server-side notifications |