2.0.18 • Published 1 year ago

@krzx000/fivem-utils v2.0.18

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

FiveM NUI Utils

A package containing most of the most important functions and hooks for creating FiveM NUI.

Version

Version

Authors

Installation

Install fivem-utils with npm.

  npm install @krzx000/fivem-util

Functions

Fetch data from NUI

fetchNui(eventName, data);
ParameterTypeRequiredDescription
eventNamestringYesThe name of the NUI event to fetch data from.
dataanyNoData payload to send along with the request.

Fetch data from NUI

useNuiEvents(action, handler);
ParameterTypeRequiredDescription
actionstringYesThe specific action that should be listened for.
datafunctionYesThe callback function that will handle data relayed by this hook

Generate a random float

randomFloat(min, max);
ParameterTypeRequiredDescription
minnumberYesThe minimum value of the range (inclusive).
maxnumberYesThe maximum value of the range (exclusive).

Generate a random int

randomInt(min, max);
ParameterTypeRequiredDescription
minnumberYesThe minimum value of the range.
maxnumberYesThe maximum value of the range.

Generate a random string

randomString(length);
ParameterTypeRequiredDescription
lengthnumberYesThe length of the random string to generate.

Returns if the environment is a browser

isEnvBrowser();
2.0.18

1 year ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.2

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9-2

1 year ago

1.0.9-1

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago