> For the complete documentation index, see [llms.txt](https://duddzy-scripts.gitbook.io/duddzy-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://duddzy-scripts.gitbook.io/duddzy-scripts-docs/scripts/duddzy-jail-1/installation.md).

# Installation

This guide explains how to install and configure the Pet System resource on your FiveM server.

***

## Requirements

Before installing the resource, make sure your server is using:

* OneSync Enabled
* ESX Legacy Framework
* An SQL database (HeidiSQL for example)
* ​[oxmysql](https://github.com/overextended/oxmysql) (Required for database storage)
* ​[ox\_inventory](https://github.com/overextended/ox_inventory) (Required for item management)
* ​[ox\_lib](https://github.com/overextended/ox_lib) (Required for UI and interactions)
* [ox\_target](https://github.com/overextended/ox_target) (Required for UI and interactions)

***

## Step 1 — Download the Resource

Place the resource folder into your server's resources directory:

Example:

```
resources/[scripts]/dz_pets
```

***

## Step 2 — Import the SQL File

Import the provided `install.sql` file into your server database or copy the query from here.

```
CREATE TABLE IF NOT EXISTS `pets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `owner` varchar(60) DEFAULT NULL,
  `modelname` varchar(250) DEFAULT NULL,
  `health` tinyint(4) NOT NULL DEFAULT 100,
  `food` tinyint(4) NOT NULL DEFAULT 100,
  `illnesses` varchar(60) NOT NULL DEFAULT 'none',
  `name` varchar(255) DEFAULT 'Pet',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
```

This will create the required `pets` table used for persistent pet storage.

***

## Step 3 — Setup Items and Images

Copy the item data from the `ox_items.txt` file to your ox\_inventory `items.lua`.

Usually found in `ox_inventory/data/`

Or just copy the data from here:

```
["tennisball"] = {
		label = "Tennis Ball",
		weight = 100,
		stack = true,
		close = true,
		description = 'A tennis ball.',
},
    
["petfood"] = {
		label = "Pet Food",
		weight = 100,
		stack = true,
		close = true,
		description = 'Tasty food for your pets.',
},
```

Then drag the images from the `INSTALL` folder to the `ox_inventory/web/images` folder.

***

## Step 4 — Ensure Dependencies

Make sure the `dependencies` start before the resource inside your `server.cfg`.

Example:

```
ensure oxmysql
ensure ox_inventory
ensure ox_lib
ensure ox_target
ensure dz_pets
```

The load order matters. Make sure oxmysql is first and ox\_lib is before dz\_pets.

***

## Step 5 — Configure the Resource

Open:

```
config.lua
```

Inside this file you can configure:

* Locale
* Pet Prices
* Shop Locations
* Clinic Locations
* Blips
* Food Settings
* Animations
* Vehicle Behaviour
* Commands
* Interaction Settings

Check the next page in this documentation for more information on configuration.

***

## Step 6 — Set Your Locale

The resource includes multilingual support.

To change language, edit:

```
Config.Locale = 'en'
```

Available locales:

* `en` — English
* `fr` — French
* `nl` — Dutch
* `es` — Spanish
* `de` — German
* `it` — Italian
* `pt` — Portuguese
* `pl` — Polish
* `ru` — Russian
* `tr` — Turkish

Locale files are located inside:

```
locales/
```

***

## Step 7 — Start the Resource

Restart your server or start the resource manually:

```
ensure dz_pets
```

***

## Important Notes

### OneSync

OneSync must be enabled for proper entity synchronization.

Recommended:

Put this into your server.cfg if it's not already.

```
set onesync on
```

***

## Adding New Locales

To add a custom language:

1. Create a new locale file inside:

```
locales/
```

2. Copy an existing locale file
3. Translate the values
4. Set your locale inside `config.lua`

Example:

```
Config.Locale = 'custom'
```

***

## Troubleshooting

***

### Pets Not Spawning

Check:

* OneSync is enabled
* the resource is ensured
* ox\_lib is started first

***

### Locale Not Changing

Check:

* the locale file exists
* the locale code matches `Config.Locale`

***

### SQL Errors

Make sure:

* the SQL file was imported correctly
* the `pets` table exists
* your database connection is working properly

If you encounter issues:

* verify installation steps
* check console errors
* ensure all dependencies are installed correctly
