Client Functions
Last updated
Last updated
Returns variables of cached client data. These variables are checked every 500ms and are updated via events(LINK TBA) if they've changed
Starts a progress bar with the specified config
Parameter | Required | Type | Description |
---|---|---|---|
Used to update the current progress bar when the length hasn't been defined.
Used to update the title/description of the active progress bar.
Cancels the active progress bar. Will run the callback function with the first parameter set to false.
Returns player (character) data
Returns player (character) item data array
Returns a bool indicating if the player (character) has loaded on the client
Returns a bool indicating if the player (character) has spawned in. This comes after the player has loaded
Returns a string of the player (characters) first and last name
Returns an array of the defined player's inventory slot
Returns a bool indicating if the player (character) is dead
Returns a bool indicating if the player (character) has a male body type
Returns a bool indicating if the player (character) has a female body type
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
Returns a bool indicating if the player (character) has the defined job and grade access
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
Returns either a bool or a string indicating if the player is on duty for a job that is a business
Returns a bool indicating if the player (character) has the defined item
Returns a number indicating the amount of defined item the player (character) has
Returns an array of the player's (character) items that the defined predicate evaluates to be true
Attempts to load the specified model with a 5 second timeout
Attempts to load the specified particle fx with a 5 second timeout
Attempts to load the specified animation dictionary with a 5 second timeout
Tasks your player to do an animation and attaches an object/prop to the player
Stops animation task and cleans up attached object/prop
Teleports player to specified coords with various options
Return a vector2 of marked blip on the map
Used to teleport the a map marker
Returns an array containing entity handles for each entity in the ped game pool
Returns an array containing entity handles for each entity in the ped game pool
Returns the closest ped entity handle and its distance
Executes a simplified config with TMC.Functions.Notify
Used to show a notification
Used to stop a notification
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
Create custom HUD elements
Update HUD element info
Used to create a timer HUD element with callback function
Used to immediately stop an active timer
Used to show the doorlock indicator HUD element
Used to hide the doorlock indicator HUD element
Used to allow the user to copy information to their clipboard
Returns a bool indicating if the client has the defined permission access
Returns a vector4 of the position of the player or the defined entity
Returns a string with the label street (and optionally the zone) at the defined coords
Returns an array containing players on the server
Returns an array of the specified player
Returns a vector4 of the specified player
Returns the number of players on the server
Returns an array of the specified player
Returns a bool indicating if the on-screen keyboard is active
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Requried | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
Parameter | Required | Type | Description |
---|---|---|---|
callback
Function
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.
length
Number
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()
title
String
The title text of the progress bar
description
String
The subtitle text of the progress bar
settings
Object
Overrides default settings. All are optional and should only be provided if you need different settings to those shown below.
slot
Number
The inventory slot number
job
String
The job name that the player must have
grade
Number
The grade number that the player must have
job
String
The job name that the player must have
grade
Number
The grade number that the player must have
maxGrade
Bool
This defines the grade floor and ceiling when checking for access
job
String
The job name that'll be used to check if the player is on duty
name
String
The item name to check for
name
String
The item name to check the amount for
model
Number
The object model hash to load
ptfx
String
The particle fx name to load
dict
String
The animation dictionary to load
options
Array
Animation/Prop configuration
options
Array
Animation/Prop configuration
coords
Vec2/3/4
Coords to teleport to
includeVehicle
Bool
If you're in a vehicle, this will teleport the vehicle and any occupants to the specified coords
delay
Number
Adds specified amount of delay (in ms) after the teleport is complete before fading the screen in
preFadeTime
Number
Screen fade out time (in ms) before teleport happens
postFadeTime
Number
Screen fade in time (in ms) after teleport happens
plyFade
Bool
If true, this will fade the entity out before the teleport and fade the entity in after the teleport
includeVehicle
Bool
Specifies if you want to teleport the vehicle that the the player is in
ignoreList
Array
An array of entities to filter out of the return array
coords
vector3
The coords at which to find the closest ped. If not passed through it'll use your ped's coords
ignoreList
Array
An array of entities to filter out of the return array
message
String
The message to include in the notification
ntype
String
The notification type to use with the notification
time
Number
The duration in ms the notification should show for
notifConfig
Array
Notification config array
id
String
Notification id to stop
ent
Number
Entity handle to delete
statName
String
The name of the element to create
statType
String
Which group of elements to add to. Supports: primary, secondary & vehicle
statConfig
Object
An object containing settings for the stat type. All parameters of the object are optional. See below for info.
statName
String
The name of the element to create
statConfig
Object
An object containing settings to update for the stat type. See below for options.
id
String
Timer ID
length
Number
Length of timer (in ms)
tooltip
String
Tooltip text that'll appear when the HUD element is hovered over
icon
String
Font Awesome icon reference
cb
Function
Callback function triggered when timer is complete
id
String
Timer ID
locked
Bool
This will indicate if the HUD element will show as an open or closed door
data
String
The data to present and copy to the clipboard
title
String
The title of the clipboard modal
reqPerm
String
The permission name
entity
Number
The entity handle to get the position of
coords
Number
The desired coords for the street label. If not defined then it'll use your player coords
disableZone
Bool
Used if you want to include the zone name or not
src
Number
The target players server id
src
Number
The target players server id
TextEntry
String
The text above the typing field in the black square
ExampleText
String
An example text, what it should say in the typing field
MaxStringLength
Number
Maximum string length