The Lab
ENTITY native

PIN_CLOSEST_MAP_ENTITY

returns Any5 paramsbuild 1207

Pins the closest map entity of modelHash to the given coordinates so it stays loaded.

Signature

C
Any PIN_CLOSEST_MAP_ENTITY(Hash modelHash, float x, float y, float z, int flags); // 0x6F3068258A499E52 b1207

Parameters

#NameType
1modelHashHash
2xfloat
3yfloat
4zfloat
5flagsint

Facts

Facts about PIN_CLOSEST_MAP_ENTITY
Name
PIN_CLOSEST_MAP_ENTITY
Hash
0x6F3068258A499E52
Namespace
Returns
Any
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result = Citizen.InvokeNative(0x6F3068258A499E52, -- PIN_CLOSEST_MAP_ENTITY
  GetHashKey("a_c_horse_arabian_white"), -- Hash modelHash
  0.0, -- float x
  0.0, -- float y
  0.0, -- float z
  0, -- int flags
  Citizen.ResultAsInteger()
)
print(result)
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const result = Citizen.invokeNative("0x6F3068258A499E52", // PIN_CLOSEST_MAP_ENTITY
  GetHashKey("a_c_horse_arabian_white"), // Hash modelHash
  0.0, // float x
  0.0, // float y
  0.0, // float z
  0, // int flags
  Citizen.resultAsInteger()
);
console.log(result)
C#
int result = Function.Call<int>((Hash)0x6F3068258A499E52, // PIN_CLOSEST_MAP_ENTITY
  (uint)API.GetHashKey("a_c_horse_arabian_white"), // Hash modelHash
  0.0f, // float x
  0.0f, // float y
  0.0f, // float z
  0 // int flags
);
All ENTITY natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.