InteriorClient

getRoomKeyFromEntity

GET_ROOM_KEY_FROM_ENTITY0x47C2A06D4F5F424B

The GTA V native GET_ROOM_KEY_FROM_ENTITY of the INTERIOR namespace, as LS:MP client scripts call it: the global function getRoomKeyFromEntity, in JavaScript and in Lua.

SignatureJavaScript
getRoomKeyFromEntity(entity: Entity): Hash
SignatureLua
getRoomKeyFromEntity(entity: Entity): Hash

Usage

JavaScript
const hash = getRoomKeyFromEntity(entity);
Lua
local hash = getRoomKeyFromEntity(entity)

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger

Returns

Hash JavaScript number, Lua integer

A game hash. Natives return it unsigned (0 to 4294967295), the value lsmp.hash gives. As an argument, the signed and unsigned forms of a hash are the same value.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

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.

Reference

Namespace
Interior INTERIOR
In the game
Hash GET_ROOM_KEY_FROM_ENTITY(Entity entity)
Hash
0x47C2A06D4F5F424B

Open in the interactive natives reference