RedM Natives

GET_NUI_CURSOR_POSITION

Hash0xBDBA226F
Runtime nameGetNuiCursorPosition
NamespaceCFX
SideClient
NameOfficial
Docs

Signature

void GET_NUI_CURSOR_POSITION(int* x, int* y);

Parameters

NameTypeDescription
xint*—
yint*—

Returns void

Usage

Lua
local x, y = GetNuiCursorPosition()

-- always works, by hash
local x, y = Citizen.InvokeNative(0xbdba226f, Citizen.PointerValueInt(), Citizen.PointerValueInt())
JavaScript and C#
JavaScript
const [x, y] = GetNuiCursorPosition();

// by hash
const [x, y] = Citizen.invokeNative('0xbdba226f', Citizen.pointerValueInt(), Citizen.pointerValueInt());
C#
var x = new OutputArgument();
var y = new OutputArgument();
Function.Call((Hash)0xbdba226f, x, y);
// x.GetResult<int>()
// y.GetResult<int>()
  • Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.