GET_SCREEN_COORD_FROM_WORLD_COORD
Hash
0xCB50D7AFCC8B0EC6Runtime name
GetScreenCoordFromWorldCoordNamespaceGRAPHICS
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0x34E82F05DF2974F5Signature
BOOL GET_SCREEN_COORD_FROM_WORLD_COORD(float worldX, float worldY, float worldZ, float* screenX, float* screenY);Parameters
| Name | Type | Description |
|---|---|---|
worldX | float | — |
worldY | float | — |
worldZ | float | — |
screenX | float* | — |
screenY | float* | — |
Returns BOOL
Usage
local retval, screenX, screenY = GetScreenCoordFromWorldCoord(worldX, worldY, worldZ)
-- always works, by hash
local retval, screenX, screenY = Citizen.InvokeNative(0xCB50D7AFCC8B0EC6, worldX, worldY, worldZ, Citizen.PointerValueFloat(), Citizen.PointerValueFloat(), Citizen.ReturnResultAnyway())JavaScript and C#
const [retval, screenX, screenY] = GetScreenCoordFromWorldCoord(worldX, worldY, worldZ);
// by hash
const [retval, screenX, screenY] = Citizen.invokeNative('0xCB50D7AFCC8B0EC6', worldX + 0.0000001, worldY + 0.0000001, worldZ + 0.0000001, Citizen.pointerValueFloat(), Citizen.pointerValueFloat(), Citizen.returnResultAnyway());var screenX = new OutputArgument();
var screenY = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0xCB50D7AFCC8B0EC6, worldX, worldY, worldZ, screenX, screenY);
// screenX.GetResult<float>()
// screenY.GetResult<float>()- Float parameters: Lua integers (
10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to non-zero floats for the same reason. - Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.