# Client Functions

### GetLocalData

Returns variables of cached client data. These variables are checked every 500ms and are updated via events(LINK TBA) if they've changed

```lua
playerId, playerPedId, position, currentVehicle, currentMount, lastMount, currentGrid = TMC.Functions.GetLocalData()

-- playerId = PlayerId()
-- playerPedId = PlayerPedId()
-- position = GetEntityCoords(PlayerPedId())
-- currentVehicle = GetVehiclePedIsIn(PlayerPedId(), false)
-- currentMount = GetMount(PlayerPedId())) RDR3 Specific
-- lastMount = GetLastMount(PlayerPedId()) RDR3 Specific
-- currentGrid = TMC.Functions.GetGridZone()
```

## Progress Bars

### ProgressBar

Starts a progress bar with the specified config

<table data-full-width="false"><thead><tr><th width="140">Parameter</th><th width="117" data-type="checkbox">Required</th><th width="116">Type</th><th>Description</th></tr></thead><tbody><tr><td>callback</td><td>true</td><td>Function</td><td>A callback function that is called when the progress bar ends. Function has a bool parameter to inform the code if it has completed the progress bar or if it was cancelled.</td></tr><tr><td>length</td><td>false</td><td>Number</td><td>The length (in milliseconds) of the progress bar. If not defined the progress bar will not tick up and can be modified with TMC.Functions.SetProgressBar()</td></tr><tr><td>title</td><td>false</td><td>String</td><td>The title text of the progress bar</td></tr><tr><td>description</td><td>false</td><td>String</td><td>The subtitle text of the progress bar</td></tr><tr><td>settings</td><td>false</td><td>Object</td><td>Overrides default settings. All are optional and should only be provided if you need different settings to those shown below.</td></tr></tbody></table>

```lua
TMC.Functions.ProgressBar(function(complete)
    if complete then
        TMC.Functions.SimpleNotify('Success!', 'success')
    end
end, 5000, 'Title', 'Optional Description', {
    canCancel = true,
    disableMovement = true,
    disableCarMovement = true,
    disableMouse = false,
    disableCombat = true,
    ragdollCancel = false,
})
```

### SetProgressBar

Used to update the current progress bar when the length hasn't been defined.

```lua
TMC.Functions.SetProgressBar(50) -- Parameter can be 0-100. When set to 100 the progressbar will be complete.
```

### UpdateProgressBar

Used to update the title/description of the active progress bar.

```lua
TMC.Functions.UpdateProgressBar('New Title', 'New Description')
```

### CancelProgressBar

Cancels the active progress bar. Will run the callback function with the first parameter set to false.

```lua
TMC.Functions.CancelProgressBar()
```

## Current Character

### GetPlayerData

Returns player (character) data

```lua
local data = TMC.Functions.GetPlayerData()
-- supports a callback function
TMC.Functions.GetPlayerData(function(data)

end)
```

### GetPlayerItems

Returns player (character) item data array

```lua
local items = TMC.Functions.GetPlayerItems()
-- supports a callback function
TMC.Functions.GetPlayerItems(function(items)

end)
```

### IsPlayerLoaded

Returns a bool indicating if the player (character) has loaded on the client

```lua
if TMC.Functions.IsPlayerLoaded() then
    --
end
```

### IsPlayerSpawned

Returns a bool indicating if the player (character) has spawned in. This comes after the player has loaded

```lua
if TMC.Functions.IsPlayerSpawned() then
    --
end
```

### GetFullName

Returns a string of the player (characters) first and last name

```lua
local fullname = TMC.Functions.GetFullName()
-- Example Output: "John Doe"
```

### GetItemBySlot

Returns an array of the defined player's inventory slot

<table><thead><tr><th>Parameter</th><th data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>slot</td><td>true</td><td>Number</td><td>The inventory slot number</td></tr></tbody></table>

```lua
local slotData = TMC.Function.GetItemBySlot(1)
-- Example Output:
-- { [1] = { ["name"] = weapon_pistol,["slot"] = 2,["info"] = { ["ammo"] = 0,["created"] = 1682364609277,["decayRate"] = 201,["serial"] = 56LEj5cI701EpHn,["decay"] = 1,["microstamp"] = 35agp9ao964apYN,} ,["amount"] = 1,["index"] = 1,} ,}
```

### IsDead

Returns a bool indicating if the player (character) is dead

```lua
if TMC.Functions.IsDead() then
    --
end
```

### IsMale

Returns a bool indicating if the player (character) has a male body type

```lua
if TMC.Functions.IsMale() then
    --
end
```

### IsFemale

Returns a bool indicating if the player (character) has a female body type

```lua
if TMC.Functions.IsFemale() then
    --
end
```

### HasJob

Returns a bool indicating if the player (character) has the defined job. If a grade is also defined, it'll return a bool indicating if the player (character) has the defined job and grade. If the player (character) doesn't have the job (and optionally, the grade) then it'll return a second string value indicating if the mismatch is the defined job or grade

<table><thead><tr><th>Parameter</th><th width="100" data-type="checkbox">Requried</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>job</td><td>true</td><td>String</td><td>The job name that the player must have</td></tr><tr><td>grade</td><td>false</td><td>Number</td><td>The grade number that the player must have</td></tr></tbody></table>

<pre class="language-lua"><code class="lang-lua"><strong>-- Example Player Job Data
</strong>-- { [1] = { ["grade"] = { ["level"] = 3,["name"] = Sergeant,} ,["onduty"] = true,["name"] = police,["isBusiness"] = false,["label"] = Law Enforcement,["isPolice"] = true,["payment"] = 870,}

if TMC.Functions.HasJob("police") then
    --
end

if TMC.Functions.HasJob("police", 3) then
    --
end

local hasJob = TMC.Functions.HasJob("police", 3)
-- hasJob = true

local hasJob, reason = TMC.Functions.HasJob("ems", 3)
-- hasJob = false
-- reason = "job"

local hasJob, reason = TMC.Functions.HasJob("police", 5)
-- hasJob = false
-- reason = "grade"
</code></pre>

### HasGrade

Returns a bool indicating if the player (character) has the defined job and grade access

<table><thead><tr><th>Parameter</th><th width="129" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>job</td><td>true</td><td>String</td><td>The job name that the player must have</td></tr><tr><td>grade</td><td>true</td><td>Number</td><td>The grade number that the player must have</td></tr><tr><td>maxGrade</td><td>true</td><td>Bool</td><td>This defines the grade floor and ceiling when checking for access</td></tr></tbody></table>

<pre class="language-lua"><code class="lang-lua">-- Example Job Grade Data
-- { [1] = "High Command Staff", [2] = "Command Staff", [3] = "Sergeant", [4] = "Senior Officer", [5] = "Officer" }

<strong>-- Example Player Job Data
</strong>-- { [1] = { ["grade"] = { ["level"] = 3,["name"] = Sergeant,} ,["onduty"] = true,["name"] = police,["isBusiness"] = false,["label"] = Law Enforcement,["isPolice"] = true,["payment"] = 870,}

if TMC.Functions.HasGrade("police", 3, false) then
    -- player has the police job and a grade level between 1 - 3
end

if TMC.Functions.HasGrade("police", 3, true) then
    -- player has the police job and a grade level between 3 - 5
end
</code></pre>

### IsOnDuty

Returns either a bool or a string indicating if the player is on duty for any or the optionally defined job. If the player is on duty, it'll also return the grade level of the on-duty job

<table><thead><tr><th>Parameter</th><th width="101" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>job</td><td>false</td><td>String</td><td>The job name that'll be used to check if the player is on duty</td></tr></tbody></table>

```lua
if TMC.Functions.IsOnDuty() then
    --
end

-- Example Player Job Data
-- { [1] = { ["grade"] = { ["level"] = 3,["name"] = Sergeant,} ,["onduty"] = true,["name"] = police,["isBusiness"] = false,["label"] = Law Enforcement,["isPolice"] = true,["payment"] = 870,}

if TMC.Functions.IsOnDuty("police") then
    --
end

local job, grade = TMC.Functions.IsOnDuty()
-- job = "police"
-- grade = 3

if TMC.Functions.IsOnDuty() == "police" then
    --
end
```

### OnDutyBusiness

Returns either a bool or a string indicating if the player is on duty for a job that is a business

```lua
if TMC.Functions.OnDutyBusiness() then
    --
end

-- Example Player Job Data
-- { [1] = { ["grade"] = { ["level"] = 1,["name"] = Manager,} ,["onduty"] = true,["name"] = realtor,["isBusiness"] = true,["label"] = Dynasty 8,["isPolice"] = false,["payment"] = 300,}

local job = TMC.Functions.OnDutyBusiness()
-- job = "realtor"

if TMC.Functions.OnDutyBusiness() == "realtor" then
    --
end
```

### HasItem

Returns a bool indicating if the player (character) has the defined item

<table><thead><tr><th>Parameter</th><th width="110" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name</td><td>true</td><td>String</td><td>The item name to check for</td></tr></tbody></table>

```lua
if TMC.Functions.HasItem("apple") then
    --
end
```

### GetItemAmountByName

Returns a number indicating the amount of defined item the player (character) has

<table><thead><tr><th>Parameter</th><th width="95" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name</td><td>true</td><td>String</td><td>The item name to check the amount for</td></tr></tbody></table>

```lua
local amount = TMC.Functions.GetItemAmountByName("apple")

if TMC.Functions.GetItemAmountByName("apple") == 1 then
    --
end
```

### GetItemsByPredicate

Returns an array of the player's (character) items that the defined predicate evaluates to be true

```lua
local goodApples = TMC.Functions.GetItemsByPredicate(function(item)
    if item and item.name == "apple" and TMC.Common.GetItemQuality(item.info) > 0 then
        return true
    end
end)

```

## Game Wrappers

### LoadModel

Attempts to load the specified model with a 5 second timeout

<table><thead><tr><th width="230">Parameter</th><th width="100" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>model</td><td>true</td><td>Number</td><td>The object model hash to load</td></tr></tbody></table>

```lua
TMC.Functions.LoadModel(GetHashKey("v_ind_ss_chair01"))
TMC.Functions.LoadModel(`v_ind_ss_chair01`)
```

### LoadParticleFx

Attempts to load the specified particle fx with a 5 second timeout

<table><thead><tr><th width="139">Parameter</th><th width="100" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>ptfx</td><td>true</td><td>String</td><td>The particle fx name to load</td></tr></tbody></table>

```lua
TMC.Functions.LoadParticleFx('scr_ih_fin')
```

### LoadAnimDict

Attempts to load the specified animation dictionary with a 5 second timeout

<table><thead><tr><th width="149">Parameter</th><th width="100" data-type="checkbox">Required</th><th width="140">Type</th><th>Description</th></tr></thead><tbody><tr><td>dict</td><td>true</td><td>String</td><td>The animation dictionary to load</td></tr></tbody></table>

```lua
TMC.Functions.LoadAnimDict('mp_common')
```

### StartPropAnim

Tasks your player to do an animation and attaches an object/prop to the player

<table><thead><tr><th width="149">Parameter</th><th width="104" data-type="checkbox">Required</th><th width="140">Type</th><th>Description</th></tr></thead><tbody><tr><td>options</td><td>true</td><td>Array</td><td>Animation/Prop configuration</td></tr></tbody></table>

```lua
local tabletAnim = TMC.Functions.StartPropAnim({
    dict = 'amb@code_human_in_bus_passenger_idles@female@tablet@idle_a',
    anim = 'idle_a',
    prop = 'prop_cs_tablet',
    boneIndex = 28422,
    placement = {-0.05, 0.0, 0.0, 0.0, 0.0, 0.0},
    duration = -1,
    delayProp = false, -- Adds a delay in ms to create/attach prop
})
```

### StopPropAnim

Stops animation task and cleans up attached object/prop

<table><thead><tr><th width="149">Parameter</th><th width="40" data-type="checkbox">Required</th><th width="140">Type</th><th>Description</th></tr></thead><tbody><tr><td>options</td><td>true</td><td>Array</td><td>Animation/Prop configuration</td></tr></tbody></table>

```lua
local tabletAnim = TMC.Functions.StartPropAnim({
    dict = 'amb@code_human_in_bus_passenger_idles@female@tablet@idle_a',
    anim = 'idle_a',
    prop = 'prop_cs_tablet',
    boneIndex = 28422,
    placement = {-0.05, 0.0, 0.0, 0.0, 0.0, 0.0},
    duration = -1,
    delayProp = false, -- Adds a delay in ms to create/attach prop
})

TMC.Functiosn.StopPropAnim(tabletAnim)
```

### TeleportToCoords

Teleports player to specified coords with various options

<table><thead><tr><th width="178">Parameter</th><th width="100" data-type="checkbox">Required</th><th width="143">Type</th><th>Description</th></tr></thead><tbody><tr><td>coords</td><td>true</td><td>Vec2/3/4</td><td>Coords to teleport to</td></tr><tr><td>includeVehicle</td><td>false</td><td>Bool</td><td>If you're in a vehicle, this will teleport the vehicle and any occupants to the specified coords</td></tr><tr><td>delay</td><td>false</td><td>Number</td><td>Adds specified amount of delay (in ms) after the teleport is complete before fading the screen in</td></tr><tr><td>preFadeTime</td><td>false</td><td>Number</td><td>Screen fade out time (in ms) before teleport happens</td></tr><tr><td>postFadeTime</td><td>false</td><td>Number</td><td>Screen fade in time (in ms) after teleport happens</td></tr><tr><td>plyFade</td><td>false</td><td>Bool</td><td>If true, this will fade the entity out before the teleport and fade the entity in after the teleport</td></tr></tbody></table>

```lua
local blipCoords = TMC.Functions.GetMarkerCoords()
TMC.Functions.TeleportToCoords(blipCoords, false, false, false, false, true)
```

### GetMarkerCoords

Return a vector2 of marked blip on the map

```lua
TMC.Functions.GetMarkerCoords()
-- Example Output: vector2(1485.76, 807.7446)
```

### TeleportToMarker

Used to teleport the a map marker

<table><thead><tr><th width="160">Parameter</th><th width="100" data-type="checkbox">Required</th><th width="143">Type</th><th>Description</th></tr></thead><tbody><tr><td>includeVehicle</td><td>true</td><td>Bool</td><td>Specifies if you want to teleport the vehicle that the the player is in</td></tr></tbody></table>

```lua
TMC.Functions.TeleportToMarker(false)
```

### GetPeds

Returns an array containing entity handles for each entity in the ped game pool&#x20;

<pre class="language-lua"><code class="lang-lua"><strong>-- GetGamePool("CPed")
</strong><strong>local peds = TMC.Functions.GetPeds()
</strong>for k,v in ipairs(peds) do
    -- v = entity
end
</code></pre>

### GetFilteredPeds

Returns an array containing entity handles for each entity in the ped game pool

<table><thead><tr><th width="154">Parameter</th><th width="127" data-type="checkbox">Required</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td>ignoreList</td><td>false</td><td>Array</td><td>An array of entities to filter out of the return array</td></tr></tbody></table>

```lua
local filterOut = {123456, 654321}
local peds = TMC.Functions.GetFilteredPeds(filterOut)
for k,v in ipairs(peds) do
    -- v = entity
end
```

### GetClosestPed

Returns the closest ped entity handle and its distance

<table><thead><tr><th width="154">Parameter</th><th width="100" data-type="checkbox">Required</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td>coords</td><td>false</td><td>vector3</td><td>The coords at which to find the closest ped. If not passed through it'll use your ped's coords</td></tr><tr><td>ignoreList</td><td>false</td><td>Array</td><td>An array of entities to filter out of the return array</td></tr></tbody></table>

```lua
local closestPed, closestDistance = TMC.Functions.GetClosestPed()

local filterOut = {123456, 654321}
local closestPed, closestDistance = TMC.Functions.GetClosestPed(GetEntityCoords(PlayerPedId()), filterOut)
```

## Notifications

### SimpleNotify

Executes a simplified config with TMC.Functions.Notify

<table><thead><tr><th width="149">Parameter</th><th width="100" data-type="checkbox">Required</th><th width="107">Type</th><th>Description</th></tr></thead><tbody><tr><td>message</td><td>true</td><td>String</td><td>The message to include in the notification</td></tr><tr><td>ntype</td><td>false</td><td>String</td><td>The notification type to use with the notification</td></tr><tr><td>time</td><td>false</td><td>Number</td><td>The duration in ms the notification should show for</td></tr></tbody></table>

```lua
TMC.Functions.SimpleNotify("Test notification", "info", 2000)
```

### Notify

Used to show a notification

<table><thead><tr><th width="149">Parameter</th><th width="100" data-type="checkbox">Required</th><th width="81">Type</th><th>Description</th></tr></thead><tbody><tr><td>notifConfig</td><td>true</td><td>Array</td><td>Notification config array</td></tr></tbody></table>

```lua
TMC.Functions.Notify({
	message = 'Test', -- String, Required
	length = 2000, -- Number (MS)
	id = 'test_notif', -- String, Required for persist notifs or updates
	persist = true, -- Boolean, requires id
	notifType = 'info', -- String (See list below)
	icon = '', -- String, can be any unicode icon
	style = {}, -- Table of css
})

-- Notif Types
-- "info"
-- "success"
-- "warning"
-- "error"
-- "loader"
-- "speech"
-- "default" (The default if nothing is entered (or `default` is entered) it has no icon unless specified with the `icon` parameter)
```

<figure><img src="/files/rDFMGWaD5mAewW3D1u3K" alt=""><figcaption></figcaption></figure>

### StopNotify

Used to stop a notification

<table><thead><tr><th width="149">Parameter</th><th width="100" data-type="checkbox">Required</th><th width="81">Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>true</td><td>String</td><td>Notification id to stop</td></tr></tbody></table>

```lua
TMC.Functions.Notify({
	message = 'Test', -- String, Required
	length = 2000, -- Number (MS)
	id = 'test_notif', -- String, Required for persist notifs or updates
	persist = true, -- Boolean, requires id
	notifType = 'info', -- String (See list below)
	icon = '', -- String, can be any unicode icon
	style = {}, -- Table of css
})

TMC.Functions.StopNotify("test_notif")
```

### DeleteEntity

Deletes a networked or non-networked entity. If the entity is networked it'll move the delete request to the server to avoid any entity ownership issues

<table><thead><tr><th width="149">Parameter</th><th width="100" data-type="checkbox">Required</th><th width="143">Type</th><th>Description</th></tr></thead><tbody><tr><td>ent</td><td>true</td><td>Number</td><td>Entity handle to delete</td></tr></tbody></table>

```lua
TMC.Functions.DeleteEntity(123456)
```

## UI Functions

### CreateUiStat

Create custom HUD elements

<table><thead><tr><th width="157">Parameter</th><th width="108" data-type="checkbox">Required</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td>statName</td><td>true</td><td>String</td><td>The name of the element to create</td></tr><tr><td>statType</td><td>false</td><td>String</td><td>Which group of elements to add to. Supports: primary, secondary &#x26; vehicle</td></tr><tr><td>statConfig</td><td>false</td><td>Object</td><td>An object containing settings for the stat type. All parameters of the object are optional. See below for info.</td></tr></tbody></table>

```lua
TMC.Functions.CreateUiStat('testStat', 'primary', {
    icon = 'fas fa-circle', -- Font awesome icon
    iconColor = nil, -- hex color for custom icon color
    color = '#6c757d', -- hex background color
    alwaysShow = false, -- Should the element always be shown
    useAlerts = false, -- Should it use the alerts system instead of percentage
    showPreferences = { -- If alwaysShow set to false custom logic
        isMinimum = true, -- Show when stat is greater than value, set to false for opposite.
        value = 0 -- value that this hud element should show at
    }
})
```

### UpdateUiStat

Update HUD element info

<table><thead><tr><th width="157">Parameter</th><th width="108" data-type="checkbox">Required</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td>statName</td><td>true</td><td>String</td><td>The name of the element to create</td></tr><tr><td>statConfig</td><td>false</td><td>Object</td><td>An object containing settings to update for the stat type. See below for options.</td></tr></tbody></table>

```lua
TMC.Functions.UpdateUiStat('testStat', {
    icon = '',
    count = 0, -- Used when "useAlerts" is set to true
    percentage = 0, -- How much to fill
    active = false, -- Toggle active icon (Voice toggle)
    visible = false, -- Force toggle visibility
    iconColour = '', -- Update the icon color
})
```

### StartTimer

Used to create a timer HUD element with callback function

<table><thead><tr><th width="160">Parameter</th><th width="100" data-type="checkbox">Required</th><th width="143">Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>true</td><td>String</td><td>Timer ID</td></tr><tr><td>length</td><td>true</td><td>Number</td><td>Length of timer (in ms)</td></tr><tr><td>tooltip</td><td>false</td><td>String</td><td>Tooltip text that'll appear when the HUD element is hovered over</td></tr><tr><td>icon</td><td>false</td><td>String</td><td>Font Awesome icon reference</td></tr><tr><td>cb</td><td>false</td><td>Function</td><td>Callback function triggered when timer is complete</td></tr></tbody></table>

```lua
TMC.Functions.StartTimer("test", 10000, "Test Tooltip", "fas fa-timer", function()
    -- timer completed
end)
```

<div><figure><img src="/files/p1jqmxYulwOXQdnBETn9" alt=""><figcaption></figcaption></figure> <figure><img src="/files/Nwoc0tFOf6SUzNO7nOvb" alt=""><figcaption></figcaption></figure></div>

### StopTimer

Used to immediately stop an active timer

<table><thead><tr><th width="160">Parameter</th><th width="100" data-type="checkbox">Required</th><th width="143">Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>true</td><td>String</td><td>Timer ID</td></tr></tbody></table>

```lua
TMC.Functions.StopTimer("test")
```

### ShowDoorlockIndicator

Used to show the doorlock indicator HUD element

<table><thead><tr><th width="160">Parameter</th><th width="100" data-type="checkbox">Required</th><th width="143">Type</th><th>Description</th></tr></thead><tbody><tr><td>locked</td><td>true</td><td>Bool</td><td>This will indicate if the HUD element will show as an open or closed door</td></tr></tbody></table>

```lua
TMC.Functions.ShowDoorlockIndicator(true)
```

<div><figure><img src="/files/zGRWUj4v3WeRM7IuwxfC" alt=""><figcaption></figcaption></figure> <figure><img src="/files/x0DOYkHtZSrhFOOXQ1vA" alt=""><figcaption></figcaption></figure></div>

### HideDoorlockIndicator

Used to hide the doorlock indicator HUD element

```lua
TMC.Functions.HideDoorlockIndicator()
```

### Clipboard

Used to allow the user to copy information to their clipboard

<table><thead><tr><th width="154">Parameter</th><th width="127" data-type="checkbox">Required</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>true</td><td>String</td><td>The data to present and copy to the clipboard</td></tr><tr><td>title</td><td>false</td><td>String</td><td>The title of the clipboard modal</td></tr></tbody></table>

```lua
TMC.Functions.Clipboard('https://discord.gg/themoddingcollective', 'TMC Discord')
```

<figure><img src="/files/uG3slGT79QBCuGQLXHyT" alt="" width="262"><figcaption></figcaption></figure>

## Other

### HasPermission

Returns a bool indicating if the client has the defined permission access

<table><thead><tr><th>Parameter</th><th data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>reqPerm</td><td>true</td><td>String</td><td>The permission name</td></tr></tbody></table>

```lua
if TMC.Functions.HasPermission("admin") then
    --
end
```

### GetCoords

Returns a vector4 of the position of the player or the defined entity

<table><thead><tr><th>Parameter</th><th width="112" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>entity</td><td>false</td><td>Number</td><td>The entity handle to get the position of</td></tr></tbody></table>

```lua
local plyPos = TMC.Functions.GetCoords()

local entityPos = TMC.Functions.GetCoords(123456)
```

### GetStreetLabel

Returns a string with the label street (and optionally the zone) at the defined coords

<table><thead><tr><th width="159">Parameter</th><th width="101" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>coords</td><td>false</td><td>Number</td><td>The desired coords for the street label. If not defined then it'll use your player coords</td></tr><tr><td>disableZone</td><td>false</td><td>Bool</td><td>Used if you want to include the zone name or not</td></tr></tbody></table>

```lua
local streetLabel = TMC.Functions.GetStreetLabel()
-- Example Output: "Alta St, Pillbox Hill" 

local streetLabel = TMC.Functions.GetStreetLabel(false, true)
-- Example Output: "Alta St"

local streetLabel = TMC.Functions.GetStreetLabel(GetEntityCoords(PlayerPedId()))
-- Example Output: "Alta St, Pillbox Hill" 
```

### GetPlayerList

Returns an array containing players on the server

```lua
local players = TMC.Functions.GetPlayerList()
-- Example Output:
-- {
--     [1] = {
--         steam = "steam:11000010abcd123",
--         name = "John Doe",
--         citizenid = "ABC12345",
--         position = vector4(-206.6901, -1015.108, 30.12231, 283.4646)
--     },
--     [2] = {
--         steam = "steam:11000010efgh456",
--         name = "Jane Doe",
--         citizenid = "EFG67890",
--         position = vector4(-206.6901, -1015.108, 30.12231, 283.4646)
--     }
-- }
```

### GetPlayer

Returns an array of the specified player

<table><thead><tr><th width="135">Parameter</th><th width="101" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>src</td><td>true</td><td>Number</td><td>The target players server id</td></tr></tbody></table>

```lua
local player = TMC.Functions.GetPlayer(GetPlayerServerId(PlayerId()))
-- Example Output:
-- [1] = {
--     steam = "steam:11000010abcd123",
--     name = "John Doe",
--     citizenid = "ABC12345",
--     position = vector4(-206.6901, -1015.108, 30.12231, 283.4646)
-- }
```

### GetCoordsForPlayer

Returns a vector4 of the specified player

<table><thead><tr><th width="230">Parameter</th><th width="100" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>src</td><td>true</td><td>Number</td><td>The target players server id</td></tr></tbody></table>

```lua
local player = TMC.Functions.GetCoordsForPlayer(GetPlayerServerId(PlayerId()))
-- Example Output: vector4(-206.6901, -1015.108, 30.12231, 283.4646)
```

### GetPlayerCount

Returns the number of players on the server

```lua
local count = TMC.Functions.GetPlayerCount()
-- Example Output: 15
```

### GetOnscreenKeyboardInput

Returns an array of the specified player

<table><thead><tr><th width="184">Parameter</th><th width="101" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>TextEntry</td><td>true</td><td>String</td><td>The text above the typing field in the black square</td></tr><tr><td>ExampleText</td><td>true</td><td>String</td><td>An example text, what it should say in the typing field</td></tr><tr><td>MaxStringLength</td><td>true</td><td>Number</td><td>Maximum string length</td></tr></tbody></table>

```lua
local text = TMC.Functions.GetOnscreenKeyboardInput("Input Text", "", 10)
-- Example Output: "Test text"
```

<figure><img src="/files/ZItWYz1UDoVIbwaiFMB0" alt=""><figcaption></figcaption></figure>

### IsOnscreenKeyboard

Returns a bool indicating if the on-screen keyboard is active

```lua
if TMC.Functions.IsOnscreenKeyboard() then
    --
end
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tmc.bj/v2/tmc-core-object/client-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
