RedM Natives

GET_SCREEN_RESOLUTION

Hardcoded to always set x to 1280 and y to 720.

Hash0x66773C92835D0909
Runtime nameGetScreenResolution
NamespaceGRAPHICS
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x888D57E407E63624

Signature

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

Parameters

NameTypeDescription
xint*—
yint*—

Returns void

Description

Hardcoded to always set x to 1280 and y to 720.

Usage

Lua
local x, y = GetScreenResolution()

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

// by hash
const [x, y] = Citizen.invokeNative('0x66773C92835D0909', Citizen.pointerValueInt(), Citizen.pointerValueInt());
C#
var x = new OutputArgument();
var y = new OutputArgument();
Function.Call((Hash)0x66773C92835D0909, 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

alloc8or RDR3 NativeDB

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