Installation
1. Dependencies
Make sure these are installed and started before the delivery job:
- Your framework:
qb-core,qbx_coreores_extended - ox_lib
- oxmysql
- vns-core - free and open source, downloaded separately from your Keymaster/cfx Portal (it is not inside the script zip and updates on its own)
- Optional: an emote resource that handles
animations:client:EmoteCommandStart(dpemotes / rpemotes) for the box-carry animation. Without it deliveries still work; see hooks to use something else.
2. Resource
Copy the vns-delivery folder into your resources and start it after vns-core:
ensure qb-core # or qbx_core / es_extended
ensure ox_lib
ensure oxmysql
ensure vns-core
ensure vns-delivery
Ensure order
vns-coremust be ensured after ox_lib, oxmysql (database), your framework, inventory, target system and your other server scripts such as housing, garages and phone.vns-deliverymust be ensured aftervns-core.
If vns-core starts too early, VNS scripts can't use your database, items, money or other systems. See Installing vns-core.
3. Jobs
Every job you want to run deliveries for must already exist in your framework (shared/jobs.lua on QBCore/QBox, the jobs table on ESX). The script compares the player's current job name with the keys in Config.Jobs; it does not create jobs.
The config ships with four example jobs (cofisland, starbucks, burgershot, pearls). Replace them with your own job names and marker positions - see Configuration.
4. Vehicles
Players take orders from the back of one of the models in Config.DeliveryVehs. Make sure employees can get one (job garage, dealer, etc.) - the script does not spawn vehicles.
5. First start
- Restart the server and give yourself one of the configured jobs.
- Go to that job's marker - you should see an orange marker and a "Delivery" text. Press E to start.
- Drive an allowed vehicle to the GPS drop, step out, press E behind the vehicle to take the order, then press E at the drop marker. The pay lands immediately.
If nothing shows at the marker, your job name doesn't match a key in Config.Jobs. If you can't take an order, the vehicle model isn't in Config.DeliveryVehs.
Encrypted variant
config.lua, client/client_open.lua and server/server_open.lua stay editable in the Encrypted variant - everything on this page and the Configuration page can be changed in both variants.
Updating from the previous version
- vns-core is now required, and the script now runs on QBox and ESX as well as QBCore. The
QBCore = exports['qb-core']:GetCoreObject()line is gone. Config.DeliveryTipis now a real percentage. It used to be a roll threshold (70meant roughly a 31% chance). Now30(the new default) means a 30% chance,0means never and100means always. Check your old value.- New
Config.MoneyType- choose whether pay and tips go to'cash'(default) or'bank'. - Vehicles accept model names or hashes -
'faggio'and`faggio`both work inConfig.DeliveryVehs. - Texts moved to
Config.Lang. All 3D texts, progress bar labels, notifications and the blip name are now inconfig.luainstead of hardcoded in the client/server files. - Payment is validated server-side. The server assigns the drop point, enforces the cooldown and run length, re-checks the job and checks the player is near the drop (with OneSync) before paying.
- File layout changed.
client/main.luaandserver/main.luaare replaced by locked files plusclient/client_open.lua/server/server_open.lua.