EntityClient

getEntityModel

GET_ENTITY_MODEL0x9F47B058362C84B5

The GTA V native GET_ENTITY_MODEL of the ENTITY namespace, as LS:MP client scripts call it: the global function getEntityModel, in JavaScript and in Lua.

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

Usage

JavaScript
const hash = getEntityModel(entity);
Lua
local hash = getEntityModel(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.

On LS:MP

✕
Can crash the game

This native reads the entity's archetype without checking that it exists. On an entity whose archetype is missing the game goes down on the spot, and doesEntityExist does not protect you. Do not call it on a handle that came back from a shape test or from lsmp.raycast. The type natives (isEntityAPed, isEntityAVehicle, isEntityAnObject) are safe. See Coverage.

Notes

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

Returns the model hash from the entity

Reference

Namespace
Entity ENTITY
In the game
Hash GET_ENTITY_MODEL(Entity entity)
Hash
0x9F47B058362C84B5

Open in the interactive natives reference