VMAG2
Returns the squared magnitude of the vector (x, y, z), avoiding a square root.
Signature
float VMAG2(float x, float y, float z); // 0xA8CEACB4F35AE058 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | x | float |
| 2 | y | float |
| 3 | z | float |
Facts
| Name | VMAG2 |
|---|---|
| Hash | 0xA8CEACB4F35AE058 |
| Namespace | |
| Returns | float |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local result = Citizen.InvokeNative(0xA8CEACB4F35AE058, -- VMAG2
0.0, -- float x
0.0, -- float y
0.0, -- float z
Citizen.ResultAsFloat()
)
print(result)// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const result = Citizen.invokeNative("0xA8CEACB4F35AE058", // VMAG2
0.0, // float x
0.0, // float y
0.0, // float z
Citizen.resultAsFloat()
);
console.log(result)float result = Function.Call<float>((Hash)0xA8CEACB4F35AE058, // VMAG2
0.0f, // float x
0.0f, // float y
0.0f // float z
);Related BUILTIN natives
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.