# Installation & Usage

## Installation

1. Add provided items & images to ox\_inventory
2. Add pet shop to ox\_inventory shops
3. Configure your config files

## Usage

### Client

To get the data of your current pet, you can use the following export, or playerstate.

```lua
local myPet = exports['xt-pets']:GetPet()

local myPet = LocalPlayer.state.pet
```

Returns table of data regarding pet info, or nil.

`id`: pet entity id\
`model`: pet entity model\
`name`: pet name\
`waiting`: pet waiting state\
`vehicle`: entity of vehicle pet is in, or false\
`seat`: seat index of pet, or false\
`animation`: pet's current animation\
`food`: pet's food value\
`water`: pet's water value\
`health`: pet's health value\
`variation`: pet's coat variation

### Server

You can get the data of all pets spawned on the server by using the following export. Returns all pets on the server, indexed by player sources.

```lua
local allPets = exports['xt-pets']:GetAllPets()
```

You can get the data of an individual player's pet by using the following export and passing the player's source as the param. Returns the pet data, or nil.

```lua
local playerPet = exports['xt-pets']:GetPet(source)
```

`active`: if pet is active\
`petName`: name of pet\
`petOwner`: cid of pet owner\
`itemName`: item used to spawn pet
