Skip to content

Instantly share code, notes, and snippets.

@t3chman
Last active November 20, 2023 12:53
Show Gist options
  • Save t3chman/73d361645fd7a4a7f3200ecb37565d4e to your computer and use it in GitHub Desktop.
Save t3chman/73d361645fd7a4a7f3200ecb37565d4e to your computer and use it in GitHub Desktop.
Cfx Lua Meta Fields - Pointer/Result Handling
Meta Fields - Pointer Handling
---------------------
The Lua runtime allows specifying pointer or result types with native execution via Meta Fields found in the `Citizen` namespace:
- PointerValueInt
- PointerValueIntInitialized
- PointerValueFloat
- PointerValueVector
- ReturnResultAnyway
- ResultAsInteger
- ResultAsLong
- ResultAsFloat
- ResultAsString
- ResultAsVector
- ResultAsObject
- Max
Example:
```lua
local found, groundZ = GetGroundZFor_3dCoord(GetEntityCoords(PlayerPedId()), Citizen.PointerValueFloat(), true)
if found then
print(groundZ)
end
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment