A package containing most of the most important functions and hooks for creating FiveM NUI.
Install fivem-utils with npm.
npm install @krzx000/fivem-util
fetchNui(eventName, data);
Parameter |
Type |
Required |
Description |
eventName |
string |
Yes |
The name of the NUI event to fetch data from. |
data |
any |
No |
Data payload to send along with the request. |
useNuiEvents(action, handler);
Parameter |
Type |
Required |
Description |
action |
string |
Yes |
The specific action that should be listened for. |
data |
function |
Yes |
The callback function that will handle data relayed by this hook |
Parameter |
Type |
Required |
Description |
min |
number |
Yes |
The minimum value of the range (inclusive). |
max |
number |
Yes |
The maximum value of the range (exclusive). |
Parameter |
Type |
Required |
Description |
min |
number |
Yes |
The minimum value of the range. |
max |
number |
Yes |
The maximum value of the range. |
Parameter |
Type |
Required |
Description |
length |
number |
Yes |
The length of the random string to generate. |
Returns if the environment is a browser