GET_HUD_SCREEN_POSITION_FROM_WORLD_POSITION
Hash
0xB39C81628EF10B42Runtime name
GetHudScreenPositionFromWorldPositionNamespaceHUD
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0xF9904D11F1ACBEC3Signature
int GET_HUD_SCREEN_POSITION_FROM_WORLD_POSITION(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 int
Usage
local retval, screenX, screenY = GetHudScreenPositionFromWorldPosition(worldX, worldY, worldZ)
-- always works, by hash
local retval, screenX, screenY = Citizen.InvokeNative(0xB39C81628EF10B42, worldX, worldY, worldZ, Citizen.PointerValueFloat(), Citizen.PointerValueFloat(), Citizen.ResultAsInteger())JavaScript and C#
const [retval, screenX, screenY] = GetHudScreenPositionFromWorldPosition(worldX, worldY, worldZ);
// by hash
const [retval, screenX, screenY] = Citizen.invokeNative('0xB39C81628EF10B42', worldX + 0.0000001, worldY + 0.0000001, worldZ + 0.0000001, Citizen.pointerValueFloat(), Citizen.pointerValueFloat(), Citizen.returnResultAnyway(), Citizen.resultAsInteger());var screenX = new OutputArgument();
var screenY = new OutputArgument();
int retval = Function.Call<int>((Hash)0xB39C81628EF10B42, 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.