Skip to content

Devchacha01/pets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

RSG-Pets:

A comprehensive and interactive pet system for RedM (RSG Framework), allowing players to buy, own, name, and care for a variety of domestic dogs and cats.

๐ŸŒŸ Features

  • Inventory Integration: Pets are items in your inventory! You can own multiple pets. Use the item to summon your companion.
  • Pet Shop UI: Beautiful, interactive NUI for purchasing pets with custom icons.
  • Persistent Naming: Name your pet! The name is saved to the item itself, so your "Rufus" stays "Rufus" forever.
  • Needs System: Pets get hungry and lose health. Feed them to keep them happy.
  • Interactions (Third-Eye):
    • โค๏ธ Pet: Show some love.
    • โœ‹ Stay: Tell your pet to wait at a location.
    • ๐Ÿšถ Follow: Call your pet to your side.
    • ๐Ÿ›๏ธ Rest: Have your pet lay down/sleep.
    • ๐Ÿ“Š Status: Check health, hunger, and age.
    • ๐Ÿ— Feed: Open a menu to feed your pet specific food items.
    • ๐Ÿ–Š๏ธ Rename: Give your friend a unique name.
    • ๐Ÿšช Flee: Dismiss your pet (despawn) back to the "ether" (it remains in your inventory).
  • Consistent Appearance: Pets spawn with fixed coat colorsโ€”no more random changing identities!
  • Smart AI: Pets follow you, relax when you stop, and can be whistled for if they get lost.

๐Ÿ“‹ Dependencies

  • rsg-core
  • rsg-inventory
  • rsg-target
  • ox_lib

๐Ÿ› ๏ธ Installation

  1. Download & Install:

    • Place rsg-pets into your resources directory.
    • Add ensure rsg-pets to your server.cfg.
  2. Add Items:

    • Add the following items to your rsg-core/shared/items.lua (or database):
    -- Pet Items
    ['foxhound'] = {['name'] = 'foxhound', ['label'] = 'American Foxhound', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_americanfoxhound.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A loyal hound.'},
    ['sheperd'] = {['name'] = 'sheperd', ['label'] = 'Australian Shepherd', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_australianshepherd.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'An intelligent herder.'},
    ['coonhound'] = {['name'] = 'coonhound', ['label'] = 'Bluetick Coonhound', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_bluetickcoonhound.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Expert tracker.'},
    ['catahoulacur'] = {['name'] = 'catahoulacur', ['label'] = 'Catahoula Cur', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_catahoularcur.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Versatile working dog.'},
    ['bayretriever'] = {['name'] = 'bayretriever', ['label'] = 'Chesapeake Retriever', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_chesbayretriever.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Excellent swimmer.'},
    ['collie'] = {['name'] = 'collie', ['label'] = 'Border Collie', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_collie.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Smartest dog breed.'},
    ['hound'] = {['name'] = 'hound', ['label'] = 'Hound Dog', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_hound.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Classic hunter.'},
    ['husky'] = {['name'] = 'husky', ['label'] = 'Husky', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_husky.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Strong sled dog.'},
    ['lab'] = {['name'] = 'lab', ['label'] = 'Labrador', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_lab.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Friendly companion.'},
    ['poodle'] = {['name'] = 'poodle', ['label'] = 'Poodle', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_poodle.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Elegant breed.'},
    ['street'] = {['name'] = 'street', ['label'] = 'Street Mutt', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_street.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Tough survivor.'},
    ['rufus'] = {['name'] = 'rufus', ['label'] = 'Rufus', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_rufus.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Reliable farm dog.'},
    ['lionpoodle'] = {['name'] = 'lionpoodle', ['label'] = 'Lion Poodle', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_dog_lionpoodle.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Fancy groomed poodle.'},
    ['tabbycat'] = {['name'] = 'tabbycat', ['label'] = 'Tabby Cat', ['weight'] = 0, ['type'] = 'item', ['image'] = 'animal_cat_tabby.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Lovable barn cat.'},
    
    -
    
  3. Images:

    • Ensure all pet images (found in html/img/) are also copied to rsg-inventory/html/images/.

โš™๏ธ Configuration

Check config.lua to customize:

  • Pets: Define breeds, prices, models, descriptions, and skins (set skin = 0 to fix colors).
  • Pet Shop Locations: Move the NPC and shop interaction zone.
  • Pet Behavior: Adjust follow distance, wandering radius, etc.
  • Pet Food: Define what items can be fed to pets and how much they restore.

๐ŸŽฎ Usage

  • Buying: Visit the Pet Shop (blip on map) and talk to the NPC.
  • Summoning: Use the pet item in your inventory.
  • Dismissing: Target your pet (Left Alt) and select "Flee".
  • Interacting: Target your pet to see all options (Feed, Rename, Stay, etc.).

๐Ÿ“ Commands

  • /petwhistle - Call your active pet to your current location (if they are spawned).
  • /petdismiss - Emergency command to despawn your active pet.

๐Ÿ› Troubleshooting

  • Floating NPC: Ensure SpawnShopNPC has valid ground snapping logic (already fixed in client.lua).
  • Random Colors: Ensure skin = 0 is set in config.lua for each pet (already fixed).
  • Missing Images: Ensure images are in BOTH rsg-pets/html/img/ AND rsg-inventory/html/images/.

Created for RedM RSG Framework

About

Redm Pet script for RSG Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published