vmag
VMAG0x652D2EEEF1D3E62CThe GTA V native VMAG of the BUILTIN namespace, as LS:MP client scripts call it: the global function vmag, in JavaScript and in Lua.
vmag(x: number, y: number, z: number): numbervmag(x: number, y: number, z: number): numberUsage
JavaScript
const value = vmag(x, y, z);Lua
local value = vmag(x, y, z)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
JavaScript · with vectors
const value = vmag(pos);Lua · with vectors
local value = vmag(pos)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
x | float | number | number |
y | float | number | number |
z | float | number | number |
Returns
float JavaScript number, Lua numberNotes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Calculates the magnitude of a vector.
Reference
- Namespace
- Built-in BUILTIN
- In the game
float VMAG(float x, float y, float z)- Hash
0x652D2EEEF1D3E62C