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
Progress Bars
ProgressBar
Starts a progress bar with the specified config
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.
SetProgressBar
Used to update the current progress bar when the length hasn't been defined.
UpdateProgressBar
Used to update the title/description of the active progress bar.
CancelProgressBar
Cancels the active progress bar. Will run the callback function with the first parameter set to false.
Current Character
GetPlayerData
Returns player (character) data
GetPlayerItems
Returns player (character) item data array
IsPlayerLoaded
Returns a bool indicating if the player (character) has loaded on the client
IsPlayerSpawned
Returns a bool indicating if the player (character) has spawned in. This comes after the player has loaded
GetFullName
Returns a string of the player (characters) first and last name
GetItemBySlot
Returns an array of the defined player's inventory slot
slot
Number
The inventory slot number
IsDead
Returns a bool indicating if the player (character) is dead
IsMale
Returns a bool indicating if the player (character) has a male body type
IsFemale
Returns a bool indicating if the player (character) has a female body type
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
job
String
The job name that the player must have
grade
Number
The grade number that the player must have
HasGrade
Returns a bool indicating if the player (character) has the defined job and grade access
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
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
job
String
The job name that'll be used to check if the player is on duty
OnDutyBusiness
Returns either a bool or a string indicating if the player is on duty for a job that is a business
HasItem
Returns a bool indicating if the player (character) has the defined item
name
String
The item name to check for
GetItemAmountByName
Returns a number indicating the amount of defined item the player (character) has
name
String
The item name to check the amount for
GetItemsByPredicate
Returns an array of the player's (character) items that the defined predicate evaluates to be true
Game Wrappers
LoadModel
Attempts to load the specified model with a 5 second timeout
model
Number
The object model hash to load
LoadParticleFx
Attempts to load the specified particle fx with a 5 second timeout
ptfx
String
The particle fx name to load
LoadAnimDict
Attempts to load the specified animation dictionary with a 5 second timeout
dict
String
The animation dictionary to load
StartPropAnim
Tasks your player to do an animation and attaches an object/prop to the player
options
Array
Animation/Prop configuration
StopPropAnim
Stops animation task and cleans up attached object/prop
options
Array
Animation/Prop configuration
TeleportToCoords
Teleports player to specified coords with various options
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
GetMarkerCoords
Return a vector2 of marked blip on the map
TeleportToMarker
Used to teleport the a map marker
includeVehicle
Bool
Specifies if you want to teleport the vehicle that the the player is in
GetPeds
Returns an array containing entity handles for each entity in the ped game pool
GetFilteredPeds
Returns an array containing entity handles for each entity in the ped game pool
ignoreList
Array
An array of entities to filter out of the return array
GetClosestPed
Returns the closest ped entity handle and its distance
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
Notifications
SimpleNotify
Executes a simplified config with TMC.Functions.Notify
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
Notify
Used to show a notification
notifConfig
Array
Notification config array
StopNotify
Used to stop a notification
id
String
Notification id to stop
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
ent
Number
Entity handle to delete
UI Functions
CreateUiStat
Create custom HUD elements
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.
UpdateUiStat
Update HUD element 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.
StartTimer
Used to create a timer HUD element with callback function
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
StopTimer
Used to immediately stop an active timer
id
String
Timer ID
ShowDoorlockIndicator
Used to show the doorlock indicator HUD element
locked
Bool
This will indicate if the HUD element will show as an open or closed door
HideDoorlockIndicator
Used to hide the doorlock indicator HUD element
Clipboard
Used to allow the user to copy information to their clipboard
data
String
The data to present and copy to the clipboard
title
String
The title of the clipboard modal
Other
HasPermission
Returns a bool indicating if the client has the defined permission access
reqPerm
String
The permission name
GetCoords
Returns a vector4 of the position of the player or the defined entity
entity
Number
The entity handle to get the position of
GetStreetLabel
Returns a string with the label street (and optionally the zone) at the defined coords
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
GetPlayerList
Returns an array containing players on the server
GetPlayer
Returns an array of the specified player
src
Number
The target players server id
GetCoordsForPlayer
Returns a vector4 of the specified player
src
Number
The target players server id
GetPlayerCount
Returns the number of players on the server
GetOnscreenKeyboardInput
Returns an array of the specified player
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
IsOnscreenKeyboard
Returns a bool indicating if the on-screen keyboard is active
Last updated