fivem.shared.util

..
Bits

Bitwise operations that work on FXServer.

Cooldown

A rate limiter keyed on nothing but time.

Debounce

Collapses a burst of calls into a single delayed one.

Hash

A Jenkins hash, with implicit conversion from the name it was made of.

Json

JSON encoding and decoding that works on FXServer.

KeyedCooldown

Per-key rate limiting — one independent Cooldown per key, created on demand.

LogLevel

Logger

Console logging with a resource prefix, a level filter, and FiveM's ^n colour codes.

LuaTables

Conversions between raw Lua tables and Haxe collections.

MathUtil

Small numeric helpers that the Haxe standard library doesn't ship and that game code reaches for constantly. Everything is inline, so calls vanish into the generated Lua.

Quaternion

A rotation quaternion, layout-compatible with what GET_ENTITY_QUATERNION / SET_ENTITY_QUATERNION expect.

QuaternionData

Rgba

An 8-bit RGBA colour.

RgbaData

Signal

A typed, in-process event emitter — the counterpart to FiveM's stringly typed AddEventHandler for things that never leave the resource.

SignalUnsubscribe

Removes a listener from the Signal it was added to. Calling it twice is harmless.

Stopwatch

Measures elapsed time against the game clock — for profiling a slow handler, or timing how long a player has held an interaction key.

Throttle

Runs an action at most once per interval, executing the first call immediately and ignoring the rest until the interval elapses.

Vector2

A 2D vector, sharing Vector3's design: an abstract over a bare {x, y} structure, so it is layout-compatible with Lua vector2 values returned by natives and costs nothing at runtime.

Vector2Data

Vector3

An immutable-by-convention 3D vector with full operator overloading.

Vector3Data

The structural shape every 3D vector in this library is built on.

Vector4

A 4D vector. In FiveM the overwhelmingly common use is position plus heading — spawn points, parking spots, teleport targets — which is why w is aliased as heading and why toVector3() exists to drop it again.

Vector4Data

VoidSignal

A Signal for events that carry no payload.