The FiveM developer’s field guide
Know the native.
Build the world.
Engine functions, framework docs, and game assets.
One reference. From the first lookup to the last line.
knowledge base
Explore / FiveM
Native reference
- SYSTEMint
CEIL
``` I'm guessing this rounds a float value up to the next whole number, and FLOOR rounds it down ```
0x11E019C8F43ACC8A - SYSTEMfloat
COS
Returns the cosine of the given number.
0xD0FFB162F40A139C - SYSTEMint
FLOOR
Description not yet documented
0xF34EE736CF047844 - SYSTEMfloat
_LOG10
``` NativeDB Introduced: v1604 ```
0xE816E655DE37FE20 - SYSTEMfloat
POW
Description not yet documented
0xE3621CC40F31FE2E - SYSTEMint
ROUND
Description not yet documented
0xF2DB717A73826179 - SYSTEMvoid
_SET_THREAD_PRIORITY
``` 0 = high 1 = normal 2 = low ```
0x42B65DEEF2EDF2A1 - SYSTEMvoid
SETTIMERA
Sets the value for the timer A in milliseconds
0xC1B1E9A034A63A62 - SYSTEMvoid
SETTIMERB
Sets the value for the timer B in milliseconds
0x5AE11BC36633DE4E - SYSTEMint
SHIFT_LEFT
Left bit shifts a value. It is advised you use the `<<` operator instead of this native. It does the same and is faster.
0xEDD95A39E5544DE8 - SYSTEMint
SHIFT_RIGHT
Right bit shifts a value. It is advised you use the `>>` operator instead of this native. It does the same and is faster.
0x97EF1E5BCE9DC075 - SYSTEMfloat
SIN
Returns the sine of the given number.
0x0BADBFA3B172435F - SYSTEMfloat
SQRT
Description not yet documented
0x71D93B57D07F9804 - SYSTEMint
START_NEW_SCRIPT
``` Examples: g_384A = SYSTEM::START_NEW_SCRIPT("cellphone_flashhand", 1424); l_10D = SYSTEM::START_NEW_SCRIPT("taxiService", 1828); SYSTEM::START_NEW_SCRIPT("AM_MP_YACHT", 5000); SYSTEM::START_NEW_SCRIPT("emergencycall", 512); SYSTEM::START_NEW_SCRIPT("emergencycall", 512); SYSTEM::START_NEW_SCRIPT("FM_maintain_cloud_header_data", 1424); SYSTEM::START_NEW_SCRIPT("FM_Mission_Controller", 31000); SYSTEM::START_NEW_SCRIPT("tennis_family", 3650); SYSTEM::START_NEW_SCRIPT("Celebrations", 3650); Decompiled examples of usage when starting a script: SCRIPT::REQUEST_SCRIPT(a_0); if (SCRIPT::HAS_SCRIPT_LOADED(a_0)) { SYSTEM::START_NEW_SCRIPT(a_0, v_3); SCRIPT::SET_SCRIPT_AS_NO_LONGER_NEEDED(a_0); return 1; } or: v_2 = "MrsPhilips2"; SCRIPT::REQUEST_SCRIPT(v_2); while (!SCRIPT::HAS_SCRIPT_LOADED(v_2)) { SCRIPT::REQUEST_SCRIPT(v_2); SYSTEM::WAIT(0); } sub_8792(36); SYSTEM::START_NEW_SCRIPT(v_2, 17000); SCRIPT::SET_SCRIPT_AS_NO_LONGER_NEEDED(v_2); All native script names: pastebin.com/K9adDsu4 and pastebin.com/yLNWicUi ```
0xE81651AD79516E48 - SYSTEMint
START_NEW_SCRIPT_WITH_ARGS
``` return : script thread id, 0 if failed Pass pointer to struct of args in p1, size of struct goes into p2 ```
0xB8BA7F44DF1575E1 - SYSTEMint
START_NEW_SCRIPT_WITH_NAME_HASH
Description not yet documented
0xEB1C67C3A5333A92 - SYSTEMint
START_NEW_SCRIPT_WITH_NAME_HASH_AND_ARGS
Description not yet documented
0xC4BB298BD441BE78 - SYSTEMint
TIMERA
``` Counts up. Every 1000 is 1 real-time second. Use SETTIMERA(int value) to set the timer (e.g.: SETTIMERA(0)). ```
0x83666F9FB8FEBD4B - SYSTEMint
TIMERB
Description not yet documented
0xC9D9444186B5A374 - SYSTEMfloat
TIMESTEP
``` Gets the current frame time. ```
0x0000000050597EE2 - SYSTEMfloat
TO_FLOAT
Description not yet documented
0xBBDA792448DB5A89 - SYSTEMfloat
VDIST
Calculates the distance between two points in 3D space. For performance reasons, consider using direct mathematical calculations for distance, as they can be more efficient than calling this native function. ``` NativeDB Introduced: v323 ```
0x2A488C176D52CCA5 - SYSTEMfloat
VDIST2
Calculates distance between vectors but does not perform Sqrt operations. Its way faster than [`VDIST`](#\_0x2A488C176D52CCA5), but it's not faster than direct mathematical calculations. ``` NativeDB Introduced: v323 ```
0xB7A628320EFF8E47 - SYSTEMfloat
VMAG
``` Calculates the magnitude of a vector. ```
0x652D2EEEF1D3E62C - SYSTEMfloat
VMAG2
``` Calculates the magnitude of a vector but does not perform Sqrt operations. (Its way faster) ```
0xA8CEACB4F35AE058 - SYSTEMvoid
WAIT
``` Pauses execution of the current script, please note this behavior is only seen when called from one of the game script files(ysc). In order to wait an asi script use "static void WAIT(DWORD time);" found in main.h ```
0x4EDE34FBADD967A6
A living reference. Documentation coverage varies by native and source.