Configuration
Available configuration for resource.
CFG = {}
CFG.SETTINGS = {
lang = 'en', -- 'en'
notify = 'ox', -- 'ox', 'qb', 'esx', 'native'
--[[ if you aren't using any supported database, you can enable this feature
to save everything into database.json file into your server ]]
server_saving = {
enabled = false,
savingInterval = 5 * (60 * 1000) -- 5 minutes
},
-- https://docs.fivem.net/docs/game-references/controls/ -- list of controls
controls = {
aim = {
attack = 38, -- E
go = 47 -- G
},
cam = { -- camera keys
up = 172, -- arrow up
down = 173, -- arrow down
cancel = 177, -- ESC, BACKSPACE, RIGHT CLICK
zoomUp = 241, -- scroll up
zoomDown = 242 -- scroll down
}
},
restrictions = {
--[[
ACE PERMS
- put this into your server cfg and edit identifier to yours
add_ace k9 k9 allow
add_principal identifier.license:830e0a2add6393cf28f45474dbf6ac4577f0652a k9 #sheen
]]
use_ace_perms = false, -- true / false
--[[
!!! ONLY FOR BADGER_DISCORD_API USERS !!!
- Keep in mind that ACE perms and badger_discord_api don't work together,
- badger_discord is always prioritized before ace_perms if it's enabled...
]]
badger_discord = {
enable = false, -- true/false
roles = {
-- id of role from your discord
['907104457018449941'] = true,
}
},
--[[
JOB RESTRICTIONS (only with QBCore/QBX/ESX/ND)
- jobs and grades that have access to k9 menu
- it's disabled if ace perms or badger_discord_api are enabled
]]
jobs = {
-- job name, grade numbers
['police'] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9},
}
},
-- you can lower this value if you want decrease damage of K9
-- keep in mind that it will be set for all animals that are able to attack
-- FYI, if player has 100 HP or lower, he will get instakilled automatically, thats how the game works
damage_modifier = 1.0, -- default is 1.0, min 0.01 - max 1.0,,, i personally suggest 0.7
-- if false then headshot will deal same damage as any other body shots
insta_headshot = true, -- true/false
max_dogs = 3, -- max registered dogs per character
tackle = {
enable = true, -- true or false to disable
chance = 30, -- this value is used only if level system is disabled
type = 2 -- 1 = animation, 2 = ragdoll
},
-- BETA FEATURE -- COULD HAVE SOME DESYNC ISSUES, COULD CONFLICT WITH ANTICHEAT
speeding = { -- changes base speed of dog
enable = false, -- true or false to disable
value = 1.5 -- minimal 1.0, max 2.0
},
delete_dog = { -- delete dog if
dog_dead = false, -- if u want to use this option, then disable saving of health and armor below
owner_dead = false
},
vehicle_entering = {
-- If you set it to true it will let the dog enter the vehicles with more realistic animations
-- This feature is still in BETA phase, it works but sometimes other players can see it differently
new = true,
vans = { -- some van vehicles, so it will switch animation of entering, keep in mind that this script was intended for small regular vehicles so the van entering is not perfect
[`rumpo`] = true, [`rumpo2`] = true,
[`speedo`] = true, [`speedo2`] = true,
[`speedo3`] = true, [`policet`] = true
}
},
spawn_areas = {
-- With this feature you can restrict everyone to spawn/despawn dog anywhere but in certain areas.
enable = false, -- true / false
require_house = false, -- cops will need to spawn dog house in the area first, it will also spawn the dog inside of the house
areas = {
{ radius = 30.0, coords = vector3(432.3, -981.64, 30.71) }, -- area 1
-- { radius = 30.0, coords = vector3(432.3, -981.64, 30.71) }, -- example
}
},
tracking = {
radius = 75.0, -- units, smell radius
speed = 1.0, -- dog following track speed, from 1.0 to 5.0, this value is used if you are not using LVL SYSTEM
cooldown = 3 -- minutes, make it 0 for removing cooldown
},
search = {
-- !!! ONLY FOR FRAMEWORK AND INVENTORY USERS !!!
all_weapons = true, -- true/false, it will automatically add all items that start with 'weapon' word to the list so you don't have to add them
items = { -- items that can be found by the dog
-- 'item_name', 'type' (item types are below)
thermite = 'explosives',
weed_brick = 'drugs',
-- add more here
},
--[[
!!! FOR EVERYONE !!!
If you are standalone (without framework/inventory), it will generate random type if search was successful.
If you using supported scripts, it assigns item type to items from above.
]]
item_types = {
explosives = 'Smells like explosives...',
drugs = 'Smells like drugs...',
-- add other types here
weapons = 'Smells like weapon...', -- only if all_weapons = true
},
-- duration of searching player/npc
search_time = 3, -- seconds
-- what happens if dog finds something
onSuccess = 'bark', -- 'bark', 'sit', 'laydown' or make it false to do nothing
-- player settings
player = {
chance = 30, -- % this parameter is used only if you are not using any framework/inventory
},
-- vehicle settings
vehicle = {
open_doors = true, -- open all doors while searching vehicle
-- chance to find something illegal in the vehicle
chance = 30, -- % this parameter is used only if you are not using any framework/inventory
},
-- npc settings
npc = {
chance = 30, -- % chance to find something ilegall
onSuccess = { -- if your dog finds ilegal items, npc could flee from the scene
flee = {
enabled = true, -- true / false
chance = 30, -- % chance to flee
attack = true, -- should dog attack if npc tries to flee (if u using lvl system, it still depends on chances from each lvl)
}
},
onFail = { -- if dog doesnt find anything ilegal
walk_away = true, -- send npc to walk away
}
}
},
status = {
ui = {
disable_in_vehicle = true -- true/false - disables UI when player enters vehicle
},
-- new registered dog spawns automatically with maxHealth
-- fyi if dog has 100 hp or lower, he always get killed after one shot... that's how the game works xd
-- u can set any max values
maxHealth = 200,
maxArmor = 100,
--[[
true = it will don't save these values into database,
so players are able to respawn their dog through menu without reviving option
]]
disable_hp_and_armor_saving = false,
heal = {
revive_timer = 3, -- reviving dog
timer = 3, -- for applying
amount = {from = 10, to = 25}, -- how much hp will be added to the dog
},
armor = {
timer = 3,
amount = {from = 10, to = 25}, -- how much armor will be added to the dog
},
feed = {
-- thirst and hunger gets decreased every 10 seconds
-- min 0.0, max 1.0
thirst = { from = 0.1, to = 0.3 },
hunger = { from = 0.1, to = 0.3 },
warning = 20, -- warns player if thirst/hunger is under x %
get_damaged = true, -- true/false - if dog is hungry/thirsty it will slowly decrease health
-- dog will be forced to pee / poo
-- he'll do the action after getting fed 2-3x times
peeing = true, pooping = true
}
},
leash = {
-- 1 to 4 are thick ropes. 5 and up are thin ropes. An invalid rope type such as 0 will crash the game.
-- be careful because some ropes type have graphic glitches that's why i choosed the type 1
type = 5,
max_length = 5.0 -- units, max length of leash
},
binding_system = { -- fivem keybinding system
enable = true, -- true/false
commands = {
--[[
- three parameters -
command is name of command from the list below
key is primary key for triggering
label is showed in FiveM keybinds as description for bind
- list of usable keys
https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
]]
[1] = { command = 'k9', key = 'K', label = 'Open K9 Menu' }, -- binding command k9 to K key (example)
-- [2] = { command = 'k9follow', key = 'L', label = 'K9 Follow' },
},
},
commands = {
--[[
LIST OF COMMANDS
- code_name and name of command
- change only name of command if you need to!
]]
-- menu pos
menu_top = 'k9top',
menu_down = 'k9down',
menu_left = 'k9left',
menu_right = 'k9right',
-- main
register_dog = 'k9register',
reselect = 'k9reselect',
main_menu = 'k9',
save_dog = 'k9save',
spawn = 'k9spawn',
-- -- -- --
delete = 'k9delete', -- delete k9 completely
-- actions
follow = 'k9follow',
lead = 'k9lead',
vehicle = 'k9vehicle',
search_player = 'k9searchped',
search_car = 'k9searchcar',
search_npc = 'k9searchnpc',
leash = 'k9leash',
heal = 'k9heal',
armor = 'k9armor',
track = 'k9trackall',
track_player = 'k9trackplayer',
track_by_vehicle = 'k9trackveh',
-- others
house = 'k9house',
go_into_house = 'k9enterhouse',
ball = 'k9ball',
frisbee = 'k9frisbee',
fetch = 'k9fetch',
gps = 'k9gps',
feed = 'k9feed',
carry = 'k9carry',
-- camera
toggle_camera = 'k9camera',
mount_camera = 'k9mount',
-- anim commands
sit = 'k9sit',
laydown = 'k9lay',
bark = 'k9bark',
indicate = 'k9indicate',
sniff = 'k9sniff',
beg = 'k9beg',
paw = 'k9paw',
petting = 'k9petting'
}
}
level_system.lua
lvl_system = {
disable = true, -- true/false - if true then dog will always follow your orders, you will don't receive any XP/LVLS
chance_to_receive_xp = 20, -- % chance
xp_per_action = {from = 5, to = 20}, -- randomised
levels = {
-- you can can add unlimited levels
-- xp = what XP you need to have to reach this lvl
-- fail = percentage/chance of dog to fail to comply (actions, searching, tracking etc)
-- tracking_speed = how fast is gonna follow the track, from 1.0 to 5.0
-- tackle_chance = percentage/chance to tackle player while attacking (only if tackle is enabled)
[1] = {
xp = 0,
fail = 30,
tracking_speed = 1.0,
tackle_chance = 10
},
[2] = {
xp = 150,
fail = 20,
tracking_speed = 2.0,
tackle_chance = 20
},
[3] = {
xp = 350,
fail = 10,
tracking_speed = 3.0,
tackle_chance = 30
},
[4] = {
xp = 800,
fail = 5,
tracking_speed = 4.0,
tackle_chance = 30
},
[5] = {
xp = 1500,
fail = 0,
tracking_speed = 5.0,
tackle_chance = 30
},
}
}
models_and_appearance.lua
props = {
food = `v_res_mbowl`,
ball = `w_am_baseball`,
frisbee = `p_ld_frisbee_01`,
house = `prop_doghouse_01`,
-- requires marxs props, resource must be called 'mm_k9' for detection
-- link will be added soon
marx = {
camera = `mm_k9_bodycam_botmount`
}
}
dogs = {
-- Only these dog models i found can attack
-- label and spawn name
models = {
{ label = 'Shepherd', hash = `a_c_shepherd` },
{ label = 'Rottweiler', hash = `a_c_rottweiler` },
-- paid models from moubys dog house -> https://moubys-dog-house.tebex.io/category/2145444
-- { label = 'Malinois', hash = `malinois` },
},
--[[
-- HOW IT WORKS --
As you can see there are some default models from the game base (a_c_shepherd, a_c_rottweiler)
Each of them has defined default apperance, default means it doesn't require any resource for detection, so it loads these appearance options into menu.
If you using replacement for shepherd, the most popular one then you just need to change the name of resource here or in your resources folder, so it's able to detect it.
Or it will just load 'default' appearance that doesn't fit for that model.
If you using addon model that isn't defined, it will just show 'Random Appearance' button
-- HOW TO ADD APPERANCE TO MODEL THAT ISN'T SUPPORTED YET --
Register new K9 with that model and type /k9devappearance. It will print all details into your client console (F8)
Insert those details same way like other models have it.
Keep in mind that textures always start from 0, so if totalTextures is 1 it has just one texture and you insert 0
Also most models show components and textures that doesn't do anything, it's up to you to test it out, so you keep options that actually work.
If you setup some addon model that isn't supported and you wanna contribute into this script so it's available for others,
just create ticket and post the code and it will be add in next update
]]
appearance = {
[`a_c_rottweiler`] = { -- hash
default = { -- without any resource
{
label = 'Skin',
component = 4, drawable = 0, textures = { 0, 1, 2 }
},
{
label = 'Collar Off',
component = 3, drawable = 1, textures = { 1 }
},
{
label = 'Collars',
component = 3, drawable = 0, textures = { 0, 1, 2, 3 }
},
},
},
[`a_c_shepherd`] = { -- hash
default = { -- without any resource
{
label = 'Skin',
component = 0, drawable = 0, textures = { 0, 1, 2 }
},
},
-- requires -> FREE https://forum.cfx.re/t/how-to-german-shepherd-malinois-k9-dog-1-0-1/1065040
['k9_model'] = { -- name of resource for detection
{
label = 'Skin',
component = 0, drawable = 0, textures = { 0, 1, 2 }
},
{
label = 'Vest Colour',
component = 3, drawable = 0, textures = { 0, 1, 2 }
},
{
label = 'Vest Type',
component = 8, drawable = 0, textures = { 0, 1, 2, 3, 5, 6, 7 }
},
},
-- requires -> PAID https://moubys-dog-house.tebex.io/package/5176462
['riley'] = { -- name of resource for detection
{
label = 'Skin',
component = 0, drawable = 0, textures = { 0, 1 }
},
{
label = 'Vest Off',
component = 3, drawable = 1, textures = { 0 }
},
{
label = 'Vest Type',
component = 3, drawable = 0, textures = { 0, 1, 2 }
},
}
},
-- paid model - requires -> PAID https://moubys-dog-house.tebex.io/package/6260956
[`malinois`] = { -- hash
['malinois'] = { -- name of resource for detection
{
label = 'Skin',
component = 0, drawable = 0, textures = { 0, 1, 2 }
},
{
label = 'Vest Off',
component = 3, drawable = 1, textures = { 0 }
},
{
label = 'Vest Type',
component = 3, drawable = 0, textures = { 0, 1, 2 }
},
},
},
}
}
shop_and_items.lua
--[[ !!! ONLY FOR FRAMEWORK AND INVENTORY USERS !!! ]]--
-- items settings
--[[ you can insert name of item that's required for each action,
you need to insert that item also into your inventory system so it's registered.]]
k9_items = {
ball = false, -- 'dog_ball'
frisbee = false, -- 'dog_frisbee'
camera = false, -- 'dog_camera'
armor = false, -- 'armor'
feed = false, -- 'water_bottle'
gps = false, -- 'dog_gps'
leash = false, -- 'dog_leash'
heal = false, -- 'bandage'
medkit = false -- 'medkit'
}
shop = {
enable = false, -- true/false to enable
type = 'npc', -- 'house' (dog house) or 'npc' at location
npc = { -- only for 'npc' type
skin = `s_m_y_cop_01`, -- any skin hash
pos = vector4(421.38, -1011.21, 28.12, 181.43), -- change the location
scenario = 'WORLD_HUMAN_COP_IDLES' -- https://wiki.rage.mp/index.php?title=Scenarios
},
-- items inside shop
items = {
{
label = 'Camera',
description = 'Mount bodycam and watch his perspective.',
icon = 'fa-camera',
item = 'dog_camera', -- change item to yours
price = 0,
},
{
label = 'GPS',
description = 'Never lose location of your doggie.',
icon = 'fa-location-dot',
item = 'dog_gps', -- change item to yours
price = 0,
},
{
label = 'Food',
description = "Give him some snacks, he's hungry!",
icon = 'fa-bone',
item = 'dog_snack', -- change item to yours
price = 0,
},
{
label = 'Leash',
description = "Take him for the walk.",
icon = 'fa-dog',
item = 'dog_leash', -- change item to yours
price = 0,
},
{
label = 'Armor',
description = "Increases armor to withstand more damage.",
icon = 'fa-shield-halved',
item = 'armor', -- change item to yours
price = 0,
},
{
label = 'Bandage',
description = "Restores a small amount of health.",
icon = 'fa-heart',
item = 'bandage', -- change item to yours
price = 0,
},
{
label = 'Medkit',
description = "Revives your dog.",
icon = 'fa-suitcase-medical',
item = 'bandage', -- change item to yours
price = 0,
},
--[[ { -- item name
label = 'House',
description = 'Place house for your dog buddy.',
icon = 'fa-house',
item = 'dog_house', -- change item to yours
price = 0,
},
{
label = 'Excrement Bag',
description = 'Clean after your doggie!',
icon = 'fa-poo',
item = 'dog_exbag', -- change item to yours
price = 0
} ]]
},
}
Last updated