# Functions

```lua
local TPZ = exports.tpz_core:getCoreAPI()
```

***

## API Functions (Client Side)

<details>

<summary>Player &#x26; Entity Ped API Functions</summary>

#### Get Player Client Data

```lua
-- @param data.source
-- @param data.loaded
-- @param data.identifier
-- @param data.charIdentifier
-- @param data.money
-- @param data.gold
-- @param data.blackmoney
-- @param data.firstname
-- @param data.lastname
-- @param data.gender
-- @param data.dob
-- @param data.job
-- @param data.jobGrade
-- @param data.identityId
-- @param data.defaultWeapon
-- @param data.inventoryMaxWeight
-- @param data.skinComp

local data = TPZ.GetPlayerClientData()

-- If player is in session we return the rest of the code.
if data == nil then
   return
end

print(data.firstname .. " " .. data.lastname)
```

#### Display Progress Bars

```lua
TPZ.DisplayProgressBar(cooldown, text) -- client side only
```

#### Send an announcement to the player ped.

```lua
-- @param title : The title to be displayed on the server announcement.
-- @param description : The description to be displayed on the server announcement.
-- @param duration : The time for the notification to be displayed (in milliseconds)
-- @param title_rgba : The rgba or color hash in a string (text) to change the title font color.
-- @param title_description_rgba : The rgba or color hash in a string (text) to change the description font color.

TPZ.SendAnnouncement(title, description, duration, title_rgba, title_description_rgba) -- client side only
```

#### Teleport Player to coordinates.

```lua
TPZ.TeleportToCoords(x, y, z, heading) -- client side only
```

#### Teleport Ped to coordinates.

```lua
TPZ.TeleportPedToCoords(entity, x, y, z, heading) -- client side only
```

#### Get closest peds nearby the target ped id.

```lua
-- @param entityPed : The required ped id (such as PlayerPedId() ).
-- @param distance : The distance to check for the closest peds based on the @entityPed coordinates.
-- returns table.
local closestPeds = TPZ.GetClosestPedsNearbyTargetPed(entityPed, distance)

-- The specified table returns:

-- @entity - The entity id.
-- @pedType - The entity ped type.
-- distance - How close the entity is to the @entityPed target.
-- isDead - If the entity is dead or not.
```

#### Get closest players within distance.

```lua
-- @param distance : The distance to check for the closest players.
-- returns table.
local closestPeds = TPZ.GetNearestPlayers(distance)

-- The specified table returns:

-- @entity - The player id.
```

</details>

<details>

<summary>Notifications</summary>

```lua
TPZ.NotifyLeft(firsttext, secondtext, dict, icon, duration, color) -- client side to client side
```

```lua
TPZ.NotifyTip(text, duration) -- client side to client side
```

```lua
TPZ.NotifyTop(text, location, duration) -- client side to client side
```

```lua
TPZ.NotifyRightTip(text, duration) -- client side to client side
```

```lua
TPZ.NotifyObjective(text, duration) -- client side to client side
```

```lua
TPZ.NotifySimpleTop(title, subtitle, duration) -- client side to client side
```

```lua
TPZ.NotifyAvanced(text, dict, icon, text_color, duration, quality) -- client side to client side
```

```lua
TPZ.NotifyBasicTop(text, duration) -- client side to client side
```

```lua
TPZ.NotifyCenter(text, duration) -- client side to client side
```

```lua
TPZ.NotifyBottomRight(text, duration) -- client side to client side
```

```lua
TPZ.NotifyFail(title, subtitle, duration) -- client side to client side
```

```lua
TPZ.NotifyDead(title, audioRef, audioName, duration) -- client side to client side
```

```lua
TPZ.NotifyUpdate(utitle, umsg, duration) -- client side to client side
```

```lua
TPZ.NotifyWarning(title, msg, audioRef, audioName, duration) -- client side to client side
```

```lua
TPZ.NotifyLeftRank(title, subtitle, dict, icon, duration, color) -- client side to client side
```

</details>
