FiveM Natives Reference
FiveM natives are functions exposed by GTA V or the Cfx.re runtime. Use them to read and change entities, players, vehicles, cameras, controls, graphics, and other game systems.
This page is a practical starting point for the most common natives. For every available function, parameter, return type, hash, and API set, use the official Cfx.re native reference .
Search the FiveM native API
Find a FiveM native
Search by native name, old alias, CamelCase, namespace or hash. Inspect original types and follow links for language-specific signatures.
Searching official native data…
Sources: official GTA V native dump and official Cfx native declarations. Both indexes are refreshed by the server, not downloaded in full to your browser. Cfx API sets come from their official declarations; GTA V entries must be checked individually. RedM natives are not included. Consult Cfx.re for binding-specific signatures and runtime compatibility.
The searchable catalog combines the official GTA V native dump with the separate Cfx-specific native declarations , including server functions and resource APIs. Search mixed-case names, hashes and namespaces such as CFX, HUD, PED, ENTITY and VEHICLE, or filter by explicitly declared Cfx API set.
Important: The Cfx declaration list has official client/server API-set flags. The GTA V dump does not, so it would be misleading to label every GTA V native client-only or server-compatible. API-set filters therefore cover only explicitly tagged Cfx entries. When one source is temporarily unavailable, the finder warns that results are incomplete. RedM natives are outside the scope of this GTA V / FiveM explorer. Always confirm language-specific binding details in the official Cfx.re native reference .
Source-backed contract checks
The canonical C declarations are a separate source from the official FiveM Markdown documentation . Our automated native check pins 18 representative declarations from citizenfx/natives@7263f2118982857a08787f81045fbdc3defa1d70, verifies each signature and namespace, and confirms that its corresponding local guide still references it. A weekly check compares those same contracts with current upstream master.
Scope: These are native C contracts and a targeted regression sample, not an exhaustive NativeDB mirror. They do not establish Cfx server API-set support, optional parameter behavior in Lua or JavaScript, or execution inside a Legacy/Enhanced game client. For example, GET_ENTITY_COORDS declares BOOL alive in C even though Lua examples may omit the optional wrapper argument. Consult the official native page for the API set and language binding before changing production scripts.
Find the right native
Before copying a native into a resource, check three things:
| Check | Why it matters |
|---|---|
| API set | A native may be client-only, server-only, or available in both contexts. |
| Signature | Parameters and return values can differ between similarly named functions. |
| Entity ownership | A valid network ID does not guarantee that the current client controls the entity. |
Native names are case-insensitive in the official search, so queries such as
GetEntityCoords, GET_ENTITY_COORDS, and the native hash lead to the same
reference entry.
Common player and entity natives
Get the local player ped
PlayerPedId is a client-side native. It returns the ped entity for the player
running the client script.
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
print(('Player coordinates: %.2f, %.2f, %.2f'):format(
coords.x,
coords.y,
coords.z
))On the server, use the player’s server ID with GetPlayerPed instead:
local function getPlayerPosition(playerSource)
local ped = GetPlayerPed(playerSource)
if ped == 0 then
return nil
end
return GetEntityCoords(ped)
endCheck whether an entity exists
Entity handles can become invalid when an entity is deleted or leaves scope. Check the handle before reading or changing it:
if entity ~= 0 and DoesEntityExist(entity) then
local coords = GetEntityCoords(entity)
endSpawn a vehicle safely
Client-side model creation should request the model, wait with a timeout, create the entity, and then release the model from the script’s model list.
local function loadModel(model, timeoutMs)
if not IsModelInCdimage(model) or not IsModelAVehicle(model) then
return false
end
RequestModel(model)
local deadline = GetGameTimer() + timeoutMs
while not HasModelLoaded(model) do
if GetGameTimer() >= deadline then
SetModelAsNoLongerNeeded(model) -- drop the pending request too
return false
end
Wait(0)
end
return true
end
RegisterCommand('docspawn', function()
local model = `adder`
if not loadModel(model, 5000) then
return
end
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local vehicle = CreateVehicle(
model,
coords.x,
coords.y,
coords.z,
GetEntityHeading(ped),
true, -- networked
false
)
SetModelAsNoLongerNeeded(model)
-- 0 when creation failed, e.g. client creation blocked by sv_entityLockdown.
if vehicle == 0 or not DoesEntityExist(vehicle) then
return
end
SetPedIntoVehicle(ped, vehicle, -1)
end, false)This is a development pattern. On a server with sv_entityLockdown or a
strict routing bucket, clients cannot create networked entities at all.
For persistent networked vehicles, create and authorize them through trusted
server logic with CreateVehicleServerSetter instead of accepting an arbitrary
model from a client event; see OneSync and the downloadable
vehicle lab.
Controls and drawing
Drawing natives must run every frame while the element is visible. Input checks that depend on a disabled control must use the corresponding disabled-control native.
local markerCoords = vector3(215.0, -810.0, 30.0)
CreateThread(function()
while true do
local sleep = 1000
local playerCoords = GetEntityCoords(PlayerPedId())
local distance = #(playerCoords - markerCoords)
if distance < 30.0 then
sleep = 0
DrawMarker(
1,
markerCoords.x,
markerCoords.y,
markerCoords.z - 1.0,
0.0, 0.0, 0.0,
0.0, 0.0, 0.0,
1.0, 1.0, 1.0,
80, 160, 255, 180,
false, false, 2, false,
nil, nil, false
)
if distance < 1.5 and IsControlJustReleased(0, 38) then
print('Interacted with marker')
end
end
Wait(sleep)
end
end)See the searchable control IDs and marker types for the values used by these natives.
Native usage by language
Most named natives are exposed through the runtime wrapper for each supported language:
-- Lua
local coords = GetEntityCoords(PlayerPedId())// JavaScript
const coords = GetEntityCoords(PlayerPedId());// C#
Vector3 coords = API.GetEntityCoords(API.PlayerPedId(), true);Always confirm the language-specific signature in the official reference. Do not translate parameter types by guesswork.
Performance rules
- Cache values that do not need to be recalculated every frame.
- Use
Wait(0)only for work that must render or check input each frame. - Increase the wait time when the player is far from an interaction.
- Use Lua vector math such as
#(a - b)for straightforward distance checks. - Prefer compile-time hashes such as
`adder`for constant model names. - Avoid broadcasting network events when only one client needs the result.
Use resmon and the FiveM profiler to measure the resource instead of assuming a native is slow.