class System
package fivem.client.natives
Static methods
staticceil(value:Float):Int
I'm guessing this rounds a float value up to the next whole number, and FLOOR rounds it down staticfloor(value:Float):Int
staticpow(base:Float, exponent:Float):Float
staticround(value:Float):Int
staticshiftLeft(value:Int, bitShift:Int):Int
Left bit shifts a value.
It is advised you use the << operator instead of this native. It does the same and is faster.
staticshiftRight(value:Int, bitShift:Int):Int
Right bit shifts a value.
It is advised you use the >> operator instead of this native. It does the same and is faster.
staticsqrt(value:Float):Float
staticstartNewScript(scriptName:String, stackSize:Int):Int
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/yLNWicUistaticstartNewScriptWithArgs(scriptName:String, args:Dynamic, argCount:Int, stackSize:Int):Int
return : script thread id, 0 if failed
Pass pointer to struct of args in p1, size of struct goes into p2 staticstartNewScriptWithNameHash(scriptHash:Int, stackSize:Int):Int
staticstartNewScriptWithNameHashAndArgs(scriptHash:Int, args:Dynamic, argCount:Int, stackSize:Int):Int
statictimera():Int
Counts up. Every 1000 is 1 real-time second. Use SETTIMERA(int value) to set the timer (e.g.: SETTIMERA(0)). statictimerb():Int
statictoFloat(value:Int):Float
staticvdist(x1:Float, y1:Float, z1:Float, x2:Float, y2:Float, z2:Float):Float
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: v323staticvdist2(x1:Float, y1:Float, z1:Float, x2:Float, y2:Float, z2:Float):Float
Calculates distance between vectors but does not perform Sqrt operations. Its way faster than VDIST, but it's not faster than direct mathematical calculations.
NativeDB Introduced: v323staticvmag2(x:Float, y:Float, z:Float):Float
Calculates the magnitude of a vector but does not perform Sqrt operations. (Its way faster) staticwait(ms:Int):Dynamic
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