Client Exports
This document contains all client-side exports available in Framework Core.
Interaction Prompts
Register core managed prompts. These are client-sided functions that allow you to create interactive prompt groups.
CreatePromptGroup
Create a group of prompts that can be enabled/disabled.
Parameter
prompts
List
A list of prompts to create the prompt group for
local promptGroupId = exports.core:CreatePromptGroup({
{
Id = 'prompt_internal_name',
Complete = function()
-- function to call when user selects item
end,
Title = '', -- The title of the prompt
Icon = '', -- The font-awesome icon I.e. 'fas fa-circle'
AutoComplete = false, -- Optional, auto-complete the prompt selection if only 1 prompt is available
}
})DeletePromptGroup
Remove a prompt group and delete it.
Parameter
promptGroupId
Int
The prompt group id
ShowPromptGroup
Enable interaction and visibility of a prompt group
Parameter
promptGroupId
Int
The prompt group Id to enable
promptRestrictions
List
A list of prompts to enable if you don't want to enable them all
forceUpdate
Boolean
If we should force an update when the prompt group is already enabled. I.e. to enable a new restricted set of prompts
HidePromptGroup
Hides all prompts from a group
Parameter
promptGroupId
Int
The prompt group Id
CreatePrompt
Create a new prompt within an existing prompt group.
Parameter
prompt
Table
The prompt configuration object
promptGroup
Int
The prompt group ID to add this prompt to
UpdatePromptTitle
Update the title of an existing prompt.
Parameter
promptGroup
Int
The prompt group containing the prompt
promptId
String
The id of the prompt to update
newTitle
String
The new title for the prompt
UpdatePromptIcon
Update the icon of an existing prompt.
Parameter
promptGroup
Int
The prompt group containing the prompt
promptId
String
The id of the prompt to update
newIcon
String
The new icon for the prompt
IsPromptGroupVisible
Check if a prompt group is currently visible.
Parameter
promptGroup
Int
The prompt group to check
IsPromptVisible
Check if a specific prompt is currently visible.
Parameter
promptGroup
Int
The prompt group to check
promptId
String
The prompt id to check
DeletePrompt
Delete a prompt from an existing prompt group.
Parameters
promptGroup
Yes
Int
The prompt group ID
promptId
Yes
String
The prompt ID to delete
GetGroupPrompts
Get all prompts in a prompt group.
Parameter
promptGroup
Yes
Int
The prompt group ID
Returns
Table
Table of prompts in the group, or nil if group doesn't exist
UpdatePromptComplete
Update the complete callback function for a prompt.
Parameters
promptGroup
Yes
Int
The prompt group ID
promptId
Yes
String
The prompt ID
complete
Yes
Function
New complete callback function
PolyZone Functions
Functions for creating and managing interactive zones in the game world.
AddBoxZone
Create a rectangular zone for interactions.
Parameter
name
String
Unique name for the zone
vectors
Vector3
Center coordinates of the zone
length
Number
Length of the box
width
Number
Width of the box
options
Table
Additional zone options
AddCircleZone
Create a circular zone for interactions.
Parameter
name
String
Unique name for the zone
center
Vector3
Center coordinates of the zone
radius
Number
Radius of the circle
options
Table
Additional zone options
AddPolyZoneEnterHandler
Add a callback function that triggers when a player enters a zone.
Parameter
zoneName
String
Name of the zone to monitor
cb
Function
Callback function to execute on enter
AddPolyZoneExitHandler
Add a callback function that triggers when a player exits a zone.
Parameter
zoneName
String
Name of the zone to monitor
cb
Function
Callback function to execute on exit
RemoveZoneById
Remove a zone by its ID.
Parameter
id
Yes
Number
The zone ID to remove
IsInZone
Check if the player is currently in a zone.
Parameter
name
Yes
String
Name of the zone to check
Returns
Boolean
Returns true if player is in the zone
AddZoneEvent
Add a zone event.
Parameters
eventName
Yes
String
The event name
zoneName
Yes
String
The zone name
IsCoordInPoly
Check if coordinates are within a polygon zone.
Parameters
poly
Yes
Table
Polygon coordinates
coords
Yes
Vector3
Coordinates to check
Returns
Boolean
Returns true if coordinates are in polygon
Player Functions
Functions for checking player status, jobs, groups, and data.
HasJob
Check if the player has a specific job.
Parameter
job
String
Job name to check
IsPlayerJob
Check if the player has a specific job.
Parameter
job
String
Job name to check
IsPlayerPolice
Check if the player is police and on duty.
Returns
Boolean
Returns true if player is police and on duty
HasGroup
Check if the player has any of the specified groups (jobs, gangs, etc.).
Parameter
filter
String/Table
Group name(s) or table of groups with grades
HasPrimaryGroup
Check if the player has the specified group as their primary job/gang.
Parameter
filter
String/Table
Group name(s) or table of groups with grades
GetGroups
Get all groups (jobs, gangs) the player has.
Returns
Table
Table of groups with their grades
GetPlayerData
Get the current player's data.
Returns
PlayerData
Current player data object
PlayerWithJobOnline
Check if a certain number of players with a specific job are online.
Parameters
job
Yes
String
Job name to check
amount
Yes
Number
Minimum number of players required
Returns
Boolean
Returns true if the required amount of players with the job are online
Interaction Functions
Functions for enabling and disabling interactions.
DisableInteraction
Disable a specific interaction type.
Parameter
interactType
Yes
String
The interaction type to disable
EnableInteraction
Enable a previously disabled interaction type.
Parameter
interactType
Yes
String
The interaction type to enable
CanInteract
Check if the player can interact (not paused, and interactions not disabled).
Parameter
interactionType
No
String
Optional interaction type to check
Returns
Boolean
Returns true if player can interact
UI Functions
Functions for managing UI elements, notifications, and NUI communication.
ShowPrompt
Display a simple interaction prompt.
Parameter
id
String
Unique identifier for the prompt
text
String
Text to display
icon
String
Font Awesome icon class (optional)
count
Number
Number of prompts (optional)
HidePrompt
Hide a specific prompt.
Parameter
id
String
Unique identifier for the prompt
HideAllPrompts
Hide all currently visible prompts.
UpdatePromptTitle
Update the title of a visible prompt.
Parameter
id
String
Unique identifier for the prompt
title
String
New title text
SetPhoneOnScreen
Set phone visibility on screen, Attach this to your phone system
Parameter
visible
Yes
Boolean
Whether phone is visible
PersistentNotify
Show a persistent notification that doesn't auto-remove.
Parameters
id
Yes
String
Unique notification ID
text
Yes
String/Table
Notification text or table
notifyType
No
String
Notification type
duration
No
Number
Duration (-1 for persistent)
StopNotify
Stop/remove a persistent notification.
Parameter
id
Yes
String
Notification ID to remove
Menu System
Functions for creating and managing interactive menus.
openMenu
Open an interactive menu.
Parameter
settings
Table/String
Menu settings or namespace string
elements
Table
Array of menu elements
close
Function
Callback for when menu closes (optional)
selected
Function
Callback for when item is selected (optional)
change
Function
Callback for when item changes (optional)
closeMenu
Close the currently open menu.
Parameter
namespace
String
Menu namespace to close (optional)
hideMenu
Hide/close the currently open menu (alias for closeMenu).
UpdateMenuElement
Update a menu element while menu is open.
Parameter
element
Yes
Table
Menu element table with name and updated properties
RemoveMenuElement
Remove a menu element while menu is open.
Parameter
element
Yes
Table
Menu element table with name property
Progress Bar System
Functions for displaying and managing progress bars.
StartProgressBar
Start a progress bar with customizable options.
Parameter
cb
Function
Callback function when progress completes
length
Number
Duration in milliseconds
title
String
Title text for the progress bar
description
String
Description text (optional)
config
Table
Configuration options (optional)
SetProgressBar
Update the progress bar value.
Parameter
val
Number
Progress value (0-100)
UpdateProgressBar
Update the progress bar title and description.
Parameter
title
String
New title text
description
String
New description text
CancelProgressBar
Cancel the current progress bar.
Notification System
Functions for displaying notifications to players.
Notify
Display a notification to the player.
Parameter
text
String/Table
Notification text or table with text/caption
notifyType
String
Notification type ('info', 'success', 'error', 'warning')
duration
Number
Duration in milliseconds (optional)
subTitle
String
Subtitle text (optional)
notifyPosition
String
Position on screen (optional)
notifyStyle
Table
Custom styling (optional)
notifyIcon
String
Font Awesome icon (optional)
notifyIconColor
String
Icon color (optional)
SimpleNotify
Display a simple notification with minimal parameters.
Parameter
text
String
Notification text
notifyType
String
Notification type (optional)
duration
Number
Duration in milliseconds (optional)
HUD Functions
Functions for managing the player HUD and vehicle HUD.
ShowHUD
Display the player HUD.
HideHUD
Hide the player HUD.
UpdateStatusData
Update player status data (health, armor, hunger, thirst, etc.).
Parameter
data
Table
Status data object
UpdateHunger
Update player hunger level directly (for food systems).
Parameter
value
Number
Hunger value (0-100)
UpdateThirst
Update player thirst level directly (for drink systems).
Parameter
value
Number
Thirst value (0-100)
UpdateStress
Update player stress level directly.
Parameter
value
Number
Stress value (0-100)
ShowVehicleHUD
Display the vehicle HUD.
HideVehicleHUD
Hide the vehicle HUD.
UpdateVehicleHUD
Update vehicle HUD data.
Parameter
data
Table
Vehicle data object
Entity Functions
Functions for managing entities, objects, and coordinates.
DeleteEntity
Delete a networked entity safely.
Parameter
ent
Entity
Entity to delete
DeleteLocalEntity
Delete a local (non-networked) entity.
Parameter
ent
Entity
Entity to delete
GetCoords
Get coordinates of an entity or current player position.
Parameter
entity
No
Entity
Entity to get coordinates from. If nil, returns player position
Returns
Vector4
Coordinates with heading (x, y, z, heading)
GetObjects
Get all objects in the game world.
Returns
Table
Array of all object entities
GetClosestObject
Get the closest object to coordinates, optionally filtered by model.
Parameters
filter
No
String/Table
Model name(s) to filter by
coords
No
Vector3
Coordinates to check from. If nil, uses player position
Returns
Entity
Closest object entity
Number
Distance to object
GetPlayersInArea
Get all players within a specified distance of coordinates.
Parameters
coords
No
Vector3
Coordinates to check from. If nil, uses player position
distance
No
Number
Maximum distance in meters. Default: 5.0
Returns
Table
Array of player IDs within range
SpawnLocalObject
Spawn a local object at specified coordinates.
Parameter
model
String/Number
Model name or hash
coords
Vector3
Spawn coordinates
cb
Function
Callback function (optional)
TeleportToCoords
Teleport player to specified coordinates.
Parameter
coords
Vector3/Vector4
Target coordinates
includeVehicle
Boolean
Include vehicle in teleport (optional)
delay
Number
Delay before teleport (optional)
preFadeTime
Number
Fade out time (optional)
postFadeTime
Number
Fade in time (optional)
plyFade
Boolean
Player fade effect (optional)
Animation Functions
Functions for loading and managing animations and models.
LoadAnimDict
Load an animation dictionary.
Parameter
dict
String
Animation dictionary name
RemoveAnimDict
Remove an animation dictionary from memory.
Parameter
dict
String
Animation dictionary name
LoadModel
Load a model hash.
Parameter
model
String/Number
Model name or hash
Particle Effects
Functions for creating and managing particle effects.
LoadParticleFx
Load a particle effect asset.
Parameter
ptfx
String
Particle effect asset name
StartParticleFxInArea
Start a particle effect in an area visible to nearby players.
Parameter
radius
Number
Effect radius
pos
Vector3
Position coordinates
particleId
String
Particle effect ID
allocatedId
Number
Allocated ID
ros
Table
Rotation and scale data
StartParticleFxForEntity
Start a particle effect attached to an entity visible to nearby players.
Parameters
netEnt
Yes
Number
Network entity ID
particleId
Yes
String
Particle effect ID
allocatedId
Yes
Number
Allocated ID
pos
Yes
Table
Position offset
ros
Yes
Table
Rotation and scale data
useEntityWeapon
No
Boolean
Whether to use entity's weapon bone
Prop Animation Functions
Functions for animating props attached to the player.
StartPropAnim
Start a prop animation with an object attached to the player.
Parameters
options
Yes
Table
Animation configuration table
Options Table:
dict
Yes
String
Animation dictionary
anim
Yes
String
Animation name
prop
Yes
String
Prop model name
placement
Yes
Table
Attachment position/rotation {x, y, z, rx, ry, rz}
boneIndex
Yes
Number
Ped bone index to attach to
secondprop
No
Table
Optional second prop configuration
movement
No
Number
Movement flag (default: 50)
duration
No
Number
Animation duration, -1 for infinite (default: -1)
delayProp
No
Number
Delay before attaching prop
Returns
Table
Animation options table with animId
StopPropAnim
Stop a prop animation and remove attached props.
Parameter
options
Yes
Table
Animation options table (must include animId)
Ped Functions
Functions for creating and managing peds.
EnablePed
Enable a created interaction ped.
Parameter
pedKey
Yes
String
The ped key identifier
DisablePed
Disable a created interaction ped.
Parameter
pedKey
Yes
String
The ped key identifier
CreateInteractionPed
Create an interaction ped that can be managed.
Parameters
pedKey
Yes
String
Unique key identifier for the ped
pedOptions
Yes
Table
Ped configuration options
Ped Options:
Hash
Yes
String/Number
Ped model hash
Location
Yes
Vector4
Spawn location with heading
Enabled
No
Boolean
Whether ped is enabled (default: true)
CreatePedByConfig
Create a ped from a configuration table.
Parameter
pedOptions
Yes
Table
Ped configuration table
Returns
Entity
Created ped entity
GetCreatedPed
Get a created interaction ped by key.
Parameter
name
Yes
String
Ped key identifier
Returns
Table
Ped data table or nil
Bucket Functions
Functions for managing routing buckets.
GetPlayerBucket
Get the routing bucket ID for a player.
Parameter
target
Yes
Number
Player source ID
Returns
Number
Bucket ID (0 if default)
GetPlayersInBucket
Get all players in a specific routing bucket.
Parameter
id
Yes
Number
Bucket ID
Returns
Table
Table of player IDs in bucket, or nil if bucket doesn't exist
GetNumberInBucket
Get the number of players in a routing bucket.
Parameter
id
Yes
Number
Bucket ID
Returns
Number
Number of players in bucket
GetLocalData
Get local player data (ID, ped, position, vehicle).
Returns
Number
Player ID
Entity
Player ped
Vector3
Current position
Entity
Current vehicle (or 0)
Utility Functions
Miscellaneous utility functions.
IsWearingGloves
Check if the player is currently wearing gloves.
Returns
Boolean
Returns true if player is wearing gloves
Clipboard
Show a clipboard UI to the player.
Parameters
title
No
String
Clipboard title (default: "No Title Provided")
text
No
String
Clipboard text content (default: "no text in prama")
closeClipboard
Close the clipboard UI.
Last updated
