Pack Life (pack_life)
Pets you own, walk, dress, feed and play with. Dogs, a cat and farm animals; none of them guard or attack anyone.
Runs on Qbox, QBCore and ESX. The framework is found by itself; everything framework-specific is in
bridge/client.lua and bridge/server.lua.
Needs
| Resource | Why |
|---|---|
ox_lib |
menus, notifications, callbacks |
ox_target |
the third eye on pets, shops and props |
oxmysql |
saved pets |
| an inventory | ox_inventory, or your framework's own (qb-inventory, the ESX inventory) |
Start order: your framework, ox_lib, oxmysql, ox_target, then pack_life.
The animals (the six dogs, the cat, rabbit, pig, hen and deer, with their accessories) are in this resource's
stream folder: nothing else to install for them.
Install
- Put the
pack_lifefolder in your resources and addensure pack_lifeafter the resources above. - Nothing to add to your inventory: what players buy at the pet shop is kept by the script as their pet gear
(
Config.Gear = { owned = true }), in the tablepack_life_gear. Only if you setowned = false, so that everything is a carried inventory item again, add the items frominstall/: - ox_inventory:ox_inventory_items.luaintoox_inventory/data/items.lua- QBCore inventory:qbcore_items.luaintoqb-core/shared/items.lua- ESX inventory: runesx_items.sqlonce - the pictures ininstall/imagesgo in your inventory's image folder - Restart the server. The table
pack_lifeis made on first start.
Coming from qbx_pets: stop it and remove it from your server config. On first start this script copies every pet
that is not the pit bull out of the old qbx_pets table (the old table is left as it was). The pit bull belongs to
k9_force.
The resource must keep the name pack_life: the ox_inventory items name it in their export.
A pet that does not show up: add setr pack_life_dogcheck 1 to server.cfg and use /dogcheck in game. It stands
every animal in front of you for 40 seconds and says in the F8 console which ones did not load.
What players do
/pets(or the third eye at a pet shop): buy a pet, buy supplies, bring a pet out, rename or release it.- Up to four pets can be out at once (
Config.MaxActivePets). Every one of them has every third-eye option, and each option acts on the pet you picked it on: follow, stay, sit, come, leash, accessories, tricks, pet gear, toys, send home. They follow along behind you, each in a place of its own. In a vehicle each takes a seat; one there is no seat for is out of sight for the ride and back beside you when you get out. - All your dogs can be on a leash at once: third eye on any of them > Leash all of them (or the gear list). Each
can be put on or taken off by itself too. The leashes are all in your right hand;
Config.Leash.bothHands = trueputs two in each hand. - Pet gear: bowls, houses, the cat tower, toys and the leash are bought once and owned; food and water are counted
and used up. Third eye on your pet > Pet gear (or
/petprops, or "Open pet gear" on the Supplies page) lists what you own: put things down, fill bowls, take a toy out, put the leash on. Gear cannot be handed to another player. A pet item still carried from before moves into your gear the first time you use it. - What you put down stays there, through restarts, until you pick it up, and everyone sees it: one of each bowl, and
one of each dog house, so every pet can have a house of its own. A pet sent into a house is kept there: it is lying
inside, for everyone, until you call it out (third eye on the house, or the gear list). From the server console,
petprops_listshows everything that is out andpetprops_clear <number | all>takes it away. - Third eye on your pet: follow, stay, sit, tricks, petting, its bowls and house.
/petgear: the active pet's Accessories menu (coat colour, collars, service vest or coat, bows; the pig's punk gear).- A leash (the
pet_leashitem): the dog leads out in front of you; the strap clips to the ring on its service vest, or its collar. - With
Config.Gear.owned = false: bowls, dog food, water and dog houses are items: use one to put it down. - The cat tower is an item too. Put it down, then third eye on it (or on your cat): send the cat up, pick where it goes, or let it move about by itself. "Call cat down" brings it back to you.
- A cat eats cat food (
pet_cat_food), every other pet dog food: fill the food bowl with the right one. A cat also has its own dishes (pet_cat_food_bowl,pet_cat_water_bowl): the food dish takes cat food only. - Cats have their own toys (mouse, yarn, jingle ball, catnip fish): throw one and the cat runs it down and bats it about. The feather wand is held, not thrown: click and the cat jumps at it.
- Toys are items: use one and it is in your hand. Left click throws it (the dog fetches), G hands it to the dog, H plays tug with the rope, X puts it away, E picks one up off the ground.
- Pets ride in your vehicle and get out when you do.
- Hunger, thirst and health are kept with the pet. A badly hurt pet is treated by the vet at the pet shop.
Settings
Everything is in config.lua: the pets and their prices, the shop, the leash, bowls and houses, toys, needs, health
and tricks. Each section is explained where it stands.