Yecoyz.
Docs/yecoyz_bossmenu

Vehicles

Buying work vehicles and the supported garage scripts.

Get yecoyz_bossmenu

Bosses (and employees with the vehicles permission) buy work vehicles with money from the company account.

The shop

Each job has its own list, set up in game. Open /bossmenucreator, click the job on the left and go to the Vehicles tab. From there you can add, edit and remove vehicles. Every vehicle has:

Field Description
Vehicle model Spawn name of the vehicle, checked when you save
Name in the menu Name shown in the boss menu
Price Taken from the company account
Lowest rank that can buy Picked from the job's own ranks
Category Groups the list in the menu
Garage Optional. Garage for this vehicle only
Lowest rank that may drive Optional. For jg-advancedgarages job vehicles
Picture link Optional. An https:// link to a png or jpg (Discord, Imgur and so on), shown on the vehicle in the menu

Changes are saved in the database and show in the boss menu right away. A new job starts with an empty list.

Example lists

The resource comes with example lists for police, ambulance and mechanic in sql/presets.sql. They are not added on their own. Run the file once in your database (HeidiSQL, phpMyAdmin and so on) to get them, then change them in game. Running it again never overwrites a list a job already has.

Spawn or garage

lua
Config.Vehicles.Mode = 'spawn'
Mode What happens
spawn The vehicle appears at the computer's vehicle spawn, placed with the creator
garage The vehicle is put in a garage

In spawn mode, give keys and fuel in BM.OnVehicleSpawned in client/open.lua. It already handles qb-vehiclekeys, qbx_vehiclekeys, wasabi_carlock, LegacyFuel and ox_fuel.

Job garage or own garage

lua
Config.Vehicles.Owner = 'job'

'job' puts the vehicle in the job's work garage. 'player' puts it in the buyer's own garage.

Supported garage scripts

yecoyz_core finds the garage script on its own. With Owner = 'job':

Garage script What happens
zyke_garages The job owns the vehicle and it is parked in the job's garage. Bosses manage it in zyke's vehicle management, where they choose who may drive it
jg-advancedgarages The job owns it as a job vehicle in the job garage
qbx_garages Parked in the job garage. Everyone in the job sees it when that garage has shared = true
qb-garages Parked in the job garage, listed for the buyer
esx_garage Marked with the job so job garages list it, owned by the buyer
None of these Saved in the framework's vehicle table

Which garage

lua
Config.Vehicles.Garage = nil

Leave it nil to use the defaults: the job's own garage in zyke_garages, and a garage named after the job (for example police) in the others. Set one garage for every job, or one per job:

lua
Config.Vehicles.Garage = { police = 'mrpd', ambulance = 'pillbox' }

The same can be set for every script at once in yecoyz_core's Config.Garage.JobGarages.

Tip

The purchase message tells the buyer which garage the vehicle went to.

Plates

lua
Config.Vehicles.PlatePrefix = 'LSPD'

Gives plates like LSPD1234. Leave it empty for random plates.