Page cover image

🛠️Configuration

Let's configure your new script to your liking!

Language

There are a few default languages that come with the script. You can easily add your own language or just translate one of the default ones. Let me show you how to choose your language.

1) Go to the fxmanifest.lua and look for shared_scripts.

2) You will find this on that spot:

shared_scripts {
    '@ox_lib/init.lua',
    'config.lua',
    'dependency-check.lua',
    'translations/en.lua' --CHOOSE YOUR LANGUAGE, YOU CAN ADD OTHERS
}

3) On the 4th line you see translations/en.lua this stands for English. So if you want Dutch for example you choose nl.lua instead of en.lua. This is possible because nl.lua is already present in the translations folder.

Configurations

Config.Debug

This is to enable some logging to the server console. true is enabled / false is disabled.

Config.General
Config.General = {
    Command = 'k9',
    BindKey = { enabled = true, key = 'F5'},
    Policejob = 'police',
    MenuPosition = 'top-right', --'top-left'/'top-right'/'bottom-left'/'bottom-right'
    DamageBite = 1.0, --4/5 bites (this is only towards players)
    DisableInventoryForDogs = true, --true/false - if true players that have the dog equiped cannot open their inventory
    SpawnMenu = true
}

Variables:

Command: any string

  • Command used to open the K9 menu

BindKey: table with 2 entries

  • enabled can be true or false to enable a hotkey

K9job: any job in your qb-core > shared > jobs.lua

  • This job gets used for all access to the commands / actions

Policejob: the name of the police job in your qb-core > shared > jobs.lua

  • This is used for some interactions

MenuPosition: 'top-left'/'top-right'/'bottom-left'/'bottom-right'

  • The position of the main K9 interaction menu

DamageBite: any number

  • Amount of damage a bite does to players (1.0 is 4 or 5 bites for death)

DisableInventoryForDogs: true / false

  • Disable the usage of inventory for players that are using the dog, this is to prevent weird animations and also breaks RP

SpawnMenu: true / false

  • On spawn show menu to players with job or whitelisted

Whitelist: true / false

  • Enable our whitelist system, players in the list can use the K9

UseJobAsWhitelist: true / false

  • Enable job whitelist, this means the script combines it if you enabled normal Whitelist, uses police_k9 job as whitelist

Config.Access (explained in Installation)
Config.Access = {
    ['job'] = {
        -- 'police_k9'
    },
    ['discord'] = {
        -- '123456789012345678'
    },
    ['license'] = {
        -- '0123ABC4567DEF890GHI'
    },
    ['discordrole'] = {
        ['Member'] = '123456789012345678'
    },
    ['citizenid'] = {
        -- 'ABC12345'
    }
}
  • discord: uses discord id

  • license: uses rockstar license

  • discordrole: uses discord role ['role label'] = 'role id'

  • citizenid: uses citizen id

Config.DiscordIntegration
Config.DiscordIntegration = {
    Enabled = true,
    BotToken = 'YOUR TOKEN',
    GuildId = 'YOUR SERVER ID',
}

If you want to use discord roles for whitelisting you need to enable this. You will need a discord app registration here. Paste your token in YOUR TOKEN and the discord server id in YOUR SERVER ID.

Config.Menu (add as many as you want)

options:

  • label = The label of the menu item

  • icon = The icon next to the label

  • close = Close the menu on select

use:

  • Use the menu item

event:

  • The name of the event, if you want to add your own client "backflip" event, your net event should look like this lumio-k9:client:backflip, the same for server but replace client with server.

server:

  • Is the event server or client sided

Config.BlacklistedItems (add as many as you want)

Which items the sniffing should give a notification on

Config.Units (add as many as you want)

All possible K9 units

Config.Animations (add as many as you want)
  • ['Paw']: The label of the menu item

  • animDict: The animation dictionary

  • animName: The animation name

  • exit: Only when the animation has an exit animation

  • loop: Only when the animation needs to be looped, for example barking is a 1 time animation and needs to be looped in order for the dog to keep barking

Config.FoodAndDrinks (add as many as you want)
['foodbowl'] = {
    prop = 'prop_cs_bowl_01',
    type = 'food',
    amountToAdd = 10, --max of food & water is 100 (metadata)
    timeToEat = 10, --in seconds
},
  • foodbowl: The name of the item

  • prop: The prop to spawn

  • type: food or drink

  • amountToAdd: Amount of metadata of type to add

  • timeToEat: Time to eat or drink the type

Last updated