> For the complete documentation index, see [llms.txt](https://docs.xeutrino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xeutrino.com/api-reference/natives.md).

# Native invocation (GTA V)

GTA V natives can be called as bare globals or through the `native` proxy table:

```lua
-- Bare form (recommended)
local ped = GET_PLAYER_PED(-1)
SET_ENTITY_INVINCIBLE(ped, true)

-- Explicit form
local ped = native.GET_PLAYER_PED(-1)
native.SET_ENTITY_INVINCIBLE(ped, true)
```

Names are resolved through the `natives` table provided by `/data/Nexus/Scripts/native_lib.lua`. If a name is unknown the call returns `nil` and is silently skipped.

## Argument types

Each argument is auto-converted based on its Lua type:

| Lua type       | Native treatment      |
| -------------- | --------------------- |
| integer        | 64-bit unsigned int   |
| float / number | 32-bit float          |
| boolean        | 0 / 1                 |
| string         | `const char*` pointer |

## Return values

Return values come back as an integer (the native's first return qword).

## Example

```lua
-- Keep the local player above 200 health every frame
while true do
    local ped = GET_PLAYER_PED(-1)
    if not IS_ENTITY_DEAD(ped, false) and GET_ENTITY_HEALTH(ped) < 200 then
        SET_ENTITY_HEALTH(ped, 200, 0)
    end
    script.yield(0)
end
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xeutrino.com/api-reference/natives.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
