RedM Natives

GET_ROOM_KEY_FROM_ENTITY

Gets the room hash key from the room that the specified entity is in.

Hash0x076E46E0EB52AFC6
Runtime nameGetRoomKeyFromEntity
NamespaceINTERIOR
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x47C2A06D4F5F424B

Signature

Hash GET_ROOM_KEY_FROM_ENTITY(Entity entity);

Parameters

NameTypeDescription
entityEntity—

Returns Hash

Description

Gets the room hash key from the room that the specified entity is in. Each room in every interior has a unique key. Returns 0 if the entity is outside.

Usage

Lua
local retval = GetRoomKeyFromEntity(entity)

-- always works, by hash
local retval = Citizen.InvokeNative(0x076E46E0EB52AFC6, entity, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetRoomKeyFromEntity(entity);

// by hash
const retval = Citizen.invokeNative('0x076E46E0EB52AFC6', entity, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0x076E46E0EB52AFC6, entity);

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.