Setting up keep-companion
Installation
Ensure that the necessary resources are installed on your server and follow the instructions below.
Server Requirements
Make sure the following resources are installed:
- qb-target
- qb-core
- qb-menu
- qb-inventory (lj-inventory)
Add Custom Items
Append code to the end of qb-core/shared/items.lua
to add custom items.
lua
["keepcompanionhusky"] = {
["name"] = "keepcompanionhusky",
["label"] = "Husky",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_Husky.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Husky is your royal companion!"
},
["keepcompanionpoodle"] = {
["name"] = "keepcompanionpoodle",
["label"] = "Poodle",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_Poodle.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Poodle is your royal companion!"
},
["keepcompanionrottweiler"] = {
["name"] = "keepcompanionrottweiler",
["label"] = "Rottweiler",
["weight"] = 500,
["type"] = "item",
["image"] = "A_Rottweiler.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Rottweiler is your royal companion!"
},
["keepcompanionwesty"] = {
["name"] = "keepcompanionwesty",
["label"] = "Westy",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_Westy.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Westy is your royal companion!"
},
["keepcompanionmtlion"] = {
["name"] = "keepcompanionmtlion",
["label"] = "MtLion",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_MtLion.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "MtLion is your royal companion!"
},
["keepcompanionmtlion2"] = {
["name"] = "keepcompanionmtlion2",
["label"] = "Panter",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_MtLion.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Panter is your royal companion!"
},
["keepcompanioncat"] = {
["name"] = "keepcompanioncat",
["label"] = "Cat",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_Cat_01.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Cat is your royal companion!"
},
["keepcompanionpug"] = {
["name"] = "keepcompanionpug",
["label"] = "Pug",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_Pug.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Pug is your royal companion!"
},
["keepcompanionretriever"] = {
["name"] = "keepcompanionretriever",
["label"] = "Retriever",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_Retriever.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Retriever is your royal companion!"
},
["keepcompanionshepherd"] = {
["name"] = "keepcompanionshepherd",
["label"] = "Shepherd",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_shepherd.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Shepherd is your royal companion!"
},
-- new pets
["keepcompanioncoyote"] = {
["name"] = "keepcompanioncoyote",
["label"] = "Coyote",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_Coyote.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Coyote is your royal companion!"
},
["keepcompanionrabbit"] = {
["name"] = "keepcompanionrabbit",
["label"] = "Rabbit",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_Rabbit_01.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Rabbit is your royal companion!"
},
["keepcompanionhen"] = {
["name"] = "keepcompanionhen",
["label"] = "Hen",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_Hen.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Hen is your royal companion!"
},
["keepcompanionrat"] = {
["name"] = "keepcompanionrat",
["label"] = "Rat",
["weight"] = 500,
["type"] = "item",
["image"] = "A_C_Rat.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Your royal companion!"
},
---
["petfood"] = {
["name"] = "petfood",
["label"] = "pet food",
["weight"] = 500,
["type"] = "item",
["image"] = "petfood.png",
["unique"] = false,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "food for your companion!"
},
["collarpet"] = {
["name"] = "collarpet",
["label"] = "Pet collar",
["weight"] = 500,
["type"] = "item",
["image"] = "collarpet.png",
["unique"] = false,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = true,
["description"] = "Rename your pets!"
},
["firstaidforpet"] = {
["name"] = "firstaidforpet",
["label"] = "First aid for pet",
["weight"] = 500,
["type"] = "item",
["image"] = "firstaidforpet.png",
["unique"] = false,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Revive your pet!"
},
["petnametag"] = {
["name"] = "petnametag",
["label"] = "Name tag",
["weight"] = 500,
["type"] = "item",
["image"] = "petnametag.png",
["unique"] = false,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Rename your pet"
},
["petwaterbottleportable"] = {
["name"] = "petwaterbottleportable",
["label"] = "Portable water bottle",
["weight"] = 1000,
["type"] = "item",
["image"] = "petwaterbottleportable.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Flask to store water for your pets"
},
["petgroomingkit"] = {
["name"] = "petgroomingkit",
["label"] = "Pet Grooming Kit",
["weight"] = 1000,
["type"] = "item",
["image"] = "petgroomingkit.png",
["unique"] = true,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Pet Grooming Kit"
},
Add Images
Place images in the qb-inventory/html/images
folder in the inventory. Images can be found in the provided inventory_images
folder.
Enabling K9 Functionality
To activate K9 functionality:
- Open the inventory script file
qb-inventory/server/main.lua
. - Locate the event
RegisterNetEvent('inventory:server:SetIsOpenState')
. - Insert the provided code either before or after this event, but not inside its body.