getEntityScript
GET_ENTITY_SCRIPT0xA6E9C38DB51D7748The GTA V native GET_ENTITY_SCRIPT of the ENTITY namespace, as LS:MP client scripts call it: the global function getEntityScript, in JavaScript and in Lua.
getEntityScript(entity: Entity): [text: string, script: ScrHandle]getEntityScript(entity: Entity): string, ScrHandleUsage
JavaScript
const [text, script] = getEntityScript(entity);Lua
local text, script = getEntityScript(entity)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
entity | Entity | number | integer |
Returns
2 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | text | string | string | string | The native’s own return value. |
| 2 | script | ScrHandle | number | integer | output |
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Returns the name of the script that owns/created the entity or nullptr. Second parameter is unused, can just be a nullptr.
Reference
- Namespace
- Entity ENTITY
- In the game
const char* GET_ENTITY_SCRIPT(Entity entity, ScrHandle* script)- Hash
0xA6E9C38DB51D7748