Get Police Breathalyzer running on your server: the start order, the three items, and who may use it.
On this page
Download it
Get the latest release from tr-scripts.com (tr_breathalyzer.zip) and unzip it.
Put it in your resources
Put the folder in your server's resources folder, named exactly tr_breathalyzer.
Start it after tr_core
server.cfg
ensure tr_coreensure tr_breathalyzer
Add the three items
The item entries and their pictures are in the resource's install folder. Pick your inventory:
Paste these into ox_inventory/data/items.lua, inside the returned table:
ox_inventory/data/items.lua
['breathalyzer'] = { label = 'Breathalyzer', weight = 350, stack = false, close = true, description = 'A police breath alcohol tester. Use it to take it out or put it away.',},['breathalyzer_mouthpiece'] = { label = 'Mouthpiece', weight = 5, stack = true, close = false, description = 'A sealed single-use mouthpiece for the breathalyzer.',},['breathalyzer_slip'] = { label = 'Breath test slip', weight = 1, stack = false, close = true, description = 'The printed record of a breath test. Use it to read it.',},
Then copy install/images/*.png to ox_inventory/web/images/.
Keep the breathalyzer and the slip without consume, client or server fields: using them has to reach your framework, which hands them to tr_breathalyzer.
Paste these into qb-core/shared/items.lua, inside QBShared.Items:
qb-core/shared/items.lua
breathalyzer = { name = 'breathalyzer', label = 'Breathalyzer', weight = 350, type = 'item', image = 'breathalyzer.png', unique = true, useable = true, shouldClose = true, description = 'A police breath alcohol tester. Use it to take it out or put it away.' },breathalyzer_mouthpiece = { name = 'breathalyzer_mouthpiece', label = 'Mouthpiece', weight = 5, type = 'item', image = 'breathalyzer_mouthpiece.png', unique = false, useable = false, shouldClose = false, description = 'A sealed single-use mouthpiece for the breathalyzer.' },breathalyzer_slip = { name = 'breathalyzer_slip', label = 'Breath test slip', weight = 1, type = 'item', image = 'breathalyzer_slip.png', unique = true, useable = true, shouldClose = true, description = 'The printed record of a breath test. Use it to read it.' },
Then copy install/images/*.png to qb-inventory/html/images/.
Without ox_inventory, ESX reads its items from the database. Run install/esx/items.sql once:
Then copy install/images/*.png to your inventory's image folder.
Restart the server
Your inventory reads its items when the server starts, so restart the whole server, not only the resource.
Before going live
Who may use it: police by default. Set jobs in shared/config.lua to your police job names, or false for anyone who has the item. See Configuration.
Your drinks: list your server's drink items in drinks, so drinking them counts. See Blood alcohol.
Try it alone: as an admin, /br_dummy puts a stand-in in front of you to test on (/br_dummy 0.03 for a reading under the limit, /br_dummy car in the nearest car's driver's seat; /br_dummy again sends him away).