MiscClient2 outputs

getModelDimensions

GET_MODEL_DIMENSIONS0x03E8D3D5F549087A

The GTA V native GET_MODEL_DIMENSIONS of the MISC namespace, as LS:MP client scripts call it: the global function getModelDimensions, in JavaScript and in Lua.

SignatureJavaScript
getModelDimensions(modelHash: Hash): [
  minimum: { x: number, y: number, z: number },
  maximum: { x: number, y: number, z: number }
]
SignatureLua
getModelDimensions(modelHash: Hash): Vector3, Vector3

Usage

JavaScript
const [minimum, maximum] = getModelDimensions(modelHash);
Lua
local minimum, maximum = getModelDimensions(modelHash)

Parameters

ParameterTypeJavaScriptLua
modelHashHashnumberinteger

Returns

2 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1minimumVector3{ x: number, y: number, z: number }Vector3output
2maximumVector3{ x: number, y: number, z: number }Vector3output

Notes

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

Gets the dimensions of a model.

Calculate (maximum - minimum) to get the size, in which case, Y will be how long the model is.

Example from the scripts: getModelDimensions(getEntityModel(playerPedId()), &v_1A, &v_17);

Reference

Namespace
Misc MISC
In the game
void GET_MODEL_DIMENSIONS(Hash modelHash, Vector3* minimum, Vector3* maximum)
Hash
0x03E8D3D5F549087A

Open in the interactive natives reference