2.0.18 • Published 2 years ago
@krzx000/fivem-utils v2.0.18
FiveM NUI Utils
A package containing most of the most important functions and hooks for creating FiveM NUI.
Version
Authors
Installation
Install fivem-utils with npm.
npm install @krzx000/fivem-utilFunctions
Fetch data from NUI
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. |
Fetch data from NUI
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 |
Generate a random float
randomFloat(min, max);| Parameter | Type | Required | Description |
|---|---|---|---|
min | number | Yes | The minimum value of the range (inclusive). |
max | number | Yes | The maximum value of the range (exclusive). |
Generate a random int
randomInt(min, max);| Parameter | Type | Required | Description |
|---|---|---|---|
min | number | Yes | The minimum value of the range. |
max | number | Yes | The maximum value of the range. |
Generate a random string
randomString(length);| Parameter | Type | Required | Description |
|---|---|---|---|
length | number | Yes | The length of the random string to generate. |
Returns if the environment is a browser
isEnvBrowser();2.0.18
2 years ago
2.0.6
2 years ago
2.0.5
2 years ago
2.0.4
2 years ago
2.0.2
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9-2
2 years ago
1.0.9-1
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago