Understanding and finding natives
When you write scripts for GTA V, you run into the term native right away. In practice, a native is simply an internal function of the GTA V game engine that you can call directly from your C# script.
What a native is
GTA V is built in C++. Inside the game engine, thousands of functions manage everything: spawning vehicles, playing animations, checking ped health, or controlling ragdolls.
ScriptHookVDotNet (SHVDN) provides ready-made C# properties for common tasks:
// Convenient SHVDN properties
ped.Health = 100;
ped.BlockPermanentEvents = true;
Under the hood, SHVDN is calling those engine functions for you. But SHVDN only covers a fraction of what the game can do. Whenever you need an action without an existing C# wrapper — like forcing a ped to put their hands up, checking if they are fleeing, or stopping them from writhing on the ground when dying — you call the engine function directly. That function is a native.
Every native has:
- A name: e.g.
TASK_HANDS_UP,SET_PED_CONFIG_FLAG,IS_PED_FLEEING. - A 64-bit hash: its identifier in the game binary. The
GTA.Native.Hashenum in SHVDN maps those names to their hashes so you can use them easily. - Parameters and a return type: the arguments it expects (ped handle, numbers, booleans) and what it returns.
How to find the native you need
You do not need to guess native names. In practice, you find what you need in two ways:
Search the native database
The community maintains searchable databases of all known GTA V natives, such as nativedb and FiveM Natives.
- Search by keyword in English: type what you are trying to do (
cuff,flee,ragdoll,weapon,seat,speech,aim). - Filter by namespace:
PED: ped health, flags, armor, behavior.TASK: movements, animations, scenarios, driving, combat.VEHICLE: doors, sirens, engine, vehicle damage.WEAPON: equipping weapons, attachments, ammo.HUD: minimap blips, text displays, notifications.
- Check parameters and notes: community comments frequently explain what specific flag IDs or arguments do (for example, flag 281 on
SET_PED_CONFIG_FLAGdisables writhe on dying).
Read existing mod code or decompile a DLL
When you wonder how another mod built a specific mechanic:
- Open-source mods on GitHub: search for the mechanic name to see which natives other developers call and in what order.
- Decompiling a .NET mod DLL: if a mod is not open source, its
.dllfile inscripts/is compiled .NET code. You can open it in a decompiler like ILSpy or dnSpy to inspect its C# code and see the exactFunction.Calllines it uses.
Calling a native in C#
In ScriptHookVDotNet, you call natives using Function.Call from the GTA.Native namespace:
Void call (performing an action)
using GTA;
using GTA.Native;
// Makes a ped raise their hands
Function.Call(Hash.TASK_HANDS_UP, ped.Handle, -1, Game.Player.Character.Handle, -1, false);
// Disables writhe on death (flag 281)
Function.Call(Hash.SET_PED_CONFIG_FLAG, ped.Handle, 281, true);
Call with a return value
Pass the expected return type between <T>:
using GTA;
using GTA.Native;
// Checks whether a ped is fleeing
bool isFleeing = Function.Call<bool>(Hash.IS_PED_FLEEING, ped.Handle);
// Gets ground Z altitude for a 3D coordinate
float groundZ = Function.Call<float>(Hash.GET_GROUND_Z_FOR_3D_COORD, pos.X, pos.Y, pos.Z, 0f, false);
What to watch out for
- Non-existent hashes and the AI trap ("Can't find native"): calling a hash that does not exist in the game causes ScriptHookV to crash with the error
Can't find native 0x.... This is the single most common mistake when coding with AI: LLMs frequently hallucinate plausible-sounding native names or invent fake hashes. When prompting an AI to write GTA V scripts, always feed it the exact native signature from nativedb or FiveM docs in the prompt. Never let an AI invent a native. - Pass handles, not C# objects: natives do not understand C#
PedorVehicleclasses. Always passped.Handleorvehicle.Handle. - Float vs integer: if a native expects a float, always write
0for1.0frather than an integer0. A type mismatch can corrupt arguments on the call stack. - Match return types: make sure the generic type
TonFunction.Call<T>matches what the database documentation indicates (bool,int,float,string).