EXPORTS & EVENTS
This guide explains how to utilize events and exports with the onex-interaction script.
IMPORTANT NOTE ➤ You should be familiar with Lua and the basics of FiveM events and exports. It's also helpful to have some basic knowledge of
Lua
.
false
to bypass it.NOTIFICATION SYSTEM
ARGUMENTS :
icon
:string
optional
DIMENSION :
header
:string
optional
font_type
:number
|VALUE
:1
or2
meesage
:string
color
:string
Any Valid Color Name , Code , Hash
duration
:number
0 TO INFNITY
-- icon : string(optional), header(optional) : string , font_type : number (1 or 2) , color: string, duration : number
TriggerEvent('onex-interaction:client:notify' , icon, header, font_type , meesage , color , duration)
STICKY MESSAGE
SET
ARGUMENTS :
message
:string
duration
:number
optional
-- message : string, duration(optional) : number
TriggerEvent('onex-interaction:client:setStickyMsg' , message, duration)
HIDE
TriggerEvent('onex-interaction:client:hideStickyMsg')
SET GLOBALLY
If you want to set Sticky message for everyone across the server.
ARGUMENTS :
message
:string
duration
:number
optional
-- message : string, duration(optional) : number
TriggerEvent('onex-interaction:global:setStickyMsg' , message, duration)
HIDE GLOBALLY
TriggerEvent('onex-interaction:global:hideStickyMsg')
This looks well-structured, but I can suggest some enhancements to make it even clearer and more engaging:
LEFT INTERACTION
You can use this interaction multiple times simultaneously.
uniquekey:
[string]
- This is an identifier key. You can use any string value (e.g., garagea). When you want to hide the interaction, simply pass this unique value. This flexibility allows for multiple interactions at once.
SHOW
ARGUMENTS:
-
uniquekey
:[string]
- Use any string value to uniquely identify this interaction. You can reference this key later to hide the interaction as needed.
-
key
:[string]
- The key used to trigger the interaction.
-
context
:[string]
- The contextual information related to this interaction.
-- uniquekey : string, key : string, context : string
TriggerEvent('onex-interaction:client:DrawLeft', uniquekey, key, context)
HIDE
Use this to hide a specific interaction by referencing its uniquekey
.
-- uniquekey : string
TriggerEvent('onex-interaction:client:removeLeft', uniquekey)
HIDE ON CLICK
Use this if you want the interaction to disappear upon being clicked.
-- uniquekey : string
TriggerEvent('onex-interaction:client:removeLeft_onClick', uniquekey)
MID INTERACTION
This feature allows for interactions using specific keys and messages, displayed in the middle of the screen.
SHOW MID INTERACTION
ARGUMENTS:
key
:[string]
- Specifies which key will activate the interaction.
msg
:[string]
- The help text displayed when the interaction is active.
-- key : string, msg : string
TriggerEvent('onex-interaction:client:MidInteractionShow', key, msg)
HIDE MID INTERACTION
The hide
command removes the current mid-interaction display. No arguments are required.
TriggerEvent('onex-interaction:client:MidInteractionHide')
MID CONTEXT
This feature is used for displaying mid-screen contextual messages without requiring a key binding.
SHOW MID CONTEXT
ARGUMENTS:
msg
:[string]
- The help text displayed in the mid context area.
-- msg : string
TriggerEvent('onex-interaction:client:MidContextShow', msg)
HIDE MID CONTEXT
The hide
command removes the mid context message from the screen. No arguments are required.
TriggerEvent('onex-interaction:client:MidContextHide')