natives.hasModelLoaded

From GTA Connected
Revision as of 00:14, 4 December 2025 by ChrisGame20 (talk | contribs) (Created page with "{{ScriptItem |endpoint = client |games = iv |type = function |name = natives.hasModelLoaded |parameters = int modelHash |parameter1 = int modelHash The model hash to check |usage = Returns whether the specified model has finished loading into memory. |notes = - Typically used after natives.requestModel to confirm readiness - Required before calling natives.createChar or spawning vehicles |return1 = bool True if the model is loaded, false otherwise |returnFail1 =...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Client Only icon-iv.png Online and Offline

Available since Client 1.0.0

bool natives.hasModelLoaded(int modelHash)

The natives.hasModelLoaded function is used to Returns whether the specified model has finished loading into memory.

Parameters

1) int modelHash The model hash to check.

Return

bool True if the model is loaded, false otherwise.

Notes

Examples

Example 1 - JavaScript:

const hash = natives.getHashKey("M_Y_COP"); if (natives.hasModelLoaded(hash)) {

   const ped = natives.createChar(1, hash, localPlayer.position, true);

}

Compatibility

There isn't any compatibility information for this function.