ControlsClient

setCursorPosition

SET_CURSOR_POSITION0xFC695459D4D0E219

The GTA V native SET_CURSOR_POSITION of the PAD namespace, as LS:MP client scripts call it: the global function setCursorPosition, in JavaScript and in Lua.

SignatureJavaScript
setCursorPosition(x: number, y: number): boolean
SignatureLua
setCursorPosition(x: number, y: number): boolean

Usage

JavaScript
const result = setCursorPosition(x, y);
Lua
local result = setCursorPosition(x, y)

Parameters

ParameterTypeJavaScriptLua
xfloatnumbernumber
yfloatnumbernumber

Returns

BOOL JavaScript boolean, Lua boolean

On LS:MP

ℹ
Input while LS:MP has the focus

While the LS:MP menu, the console or a focused browser holds the keyboard and mouse, this native does not reach the game: it returns false.

Reference

Namespace
Controls PAD
In the game
BOOL SET_CURSOR_POSITION(float x, float y)
Hash
0xFC695459D4D0E219
Formerly
_SET_CURSOR_LOCATION

Open in the interactive natives reference