Hey all! This is a script that allows police officers on your FiveM server to enforce the law with a K9 dog and beautiful UI (courtesy of NeroHiro). It also has a detailed logging feature which logs to a file and/or server console (configurable) whenever a player orders their K9 to do certain things. I hope you all enjoy and find this useful for the players on your server!
Updates since release
12/01/2021 - QBCORE
↳ Added the ability to search players
↳ Added the ability to log to Discord (webhook)
↳ Added the ability to whitelist multiple jobs
12/03/2021 - QBCORE
↳ You no longer need to use nh-context/nh-keyboard for the menus and keyboard inputs - if you prefer to use qb-menu/qb-input, there is now an option for that in the config
Features:
↳ Logs
↳ Extensive configuration
↳ Sit/stay, follow/recall, bark, lay down, enter/exit vehicle, attack functions
… and even more coming in future updates!
Dependencies:
↳ NeroHiro’s Context Menu v2
↳ NeroHiro’s Keyboard v2
Buy ($5):
↳ Tebex (QBCore)
↳ Tebex (Standalone)
Showcase:
Watch K9 Script (w/ Logs) | @NadPlayz | Streamable (Try this link if preview does not work)
Configuration:
Config = {}
Locale = {}
-- [[ 🟢 Configuration 🟢 ]] --
-- QBCore
Config.qbVersion = 'old' -- Change to 'new' if you are using the new QBCore version. If you do not, core functions of the script will simply not work!
-- General
Config.job = 'police' -- Job needed to use the script
Config.defaultKeybind = 'k' -- Default keybind to open menu
Config.defaultKeybindAttack = 'LMENU' -- Default keybind to attack
Config.command = 'k9' -- Command to open menu
Config.commandAttack = 'attack' -- Command to attack
-- Dog Images
Config.rottweilerIMG = "https://docs.fivem.net/peds/a_c_rottweiler.webp"
Config.huskyIMG = "https://docs.fivem.net/peds/a_c_husky.webp"
Config.retrieverIMG = "https://docs.fivem.net/peds/a_c_retriever.webp"
Config.shepherdIMG = "https://docs.fivem.net/peds/a_c_shepherd.webp"
-- Logs
Config.enableLogs = true -- Change this to false if you want to disable logs
Config.logToFile = true -- Change this to false if you do not want to log to a file // NOTE: Must have a 'log.txt' file in the resource folder.
Config.printToConsole = false -- Change this to false if you do not want every event to print to server console
-- [[ 🔴 Configuration 🔴 ]] --
-- [[ 🟢 Locale 🟢 ]] --
-- General
Locale.menu = "Police K9 Menu"
Locale.noName = "Name your police dog."
Locale.noBreed = "Set the breed of your police dog."
-- Menu Functions
Locale.sit = "Sit/Stay"
Locale.sitDesc = "Sits your dog down."
Locale.follow = "Follow/Recall"
Locale.followDesc = "Makes your dog follow you."
Locale.bark = "Bark"
Locale.barkDesc = "Makes your dog bark."
Locale.lay = "Lay Down"
Locale.layDesc = "Makes your dog lay down."
Locale.enter = "Enter Vehicle"
Locale.enterDesc = "Makes your dog enter your vehicle."
Locale.exit = "Exit Vehicle"
Locale.exitDesc = "Makes your dog exit your vehicle."
Locale.attack = "Attack"
Locale.attackDesc = "Makes your dog attack a player."
Locale.attackDesc2 = "Target Player ID"
Locale.attackDesc3 = "Police K9 Attack"
Locale.despawn = "Despawn"
Locale.despawnDesc = "Despawns your dog."
-- K9 Creation Menu Functions
Locale.setName = "Set Name"
Locale.k9Name = "K9 Name"
Locale.setBreed = "Set Breed"
Locale.createK9 = "Create K9"
Locale.createK9Desc1 = "Create your police dog."
Locale.createK9Desc2 = "Spawn your K9 into the world!"
Locale.goBack = "< Go Back"
-- Notifications
Locale.insideVehicle = "K9 is inside a vehicle"
Locale.mustBeInsideVehicle = "You must be inside a vehicle"
Locale.alreadyInsideVehicle = "K9 is already inside a vehicle"
Locale.notInsideVehicle = "K9 is not inside a vehicle"
Locale.despawned = " despawned successfully"
Locale.killed = " has been killed"
-- Logs
Locale.logSit = " sat their K9."
Locale.logFollow = " made their K9 follow."
Locale.logBark = " made their K9 bark."
Locale.logLay = " made their K9 lay down."
Locale.logEnter = " made their K9 enter a vehicle."
Locale.logExit = " made their K9 exit a vehicle."
Locale.logDespawn = " despawned their K9."
Locale.logSpawn = " spawned a K9."
Locale.logKilled = " K9 was killed."
-- [[ 🔴 Locale 🔴 ]] --
Note:
Protected by FiveM Asset Escrow system.
If you have any questions, please feel free to message me here - I would be more than happy to help. I appreciate feedback and constructive criticism. Thank you!