natives.hasModelLoaded
Jump to navigation
Jump to search
Function Client Only ![]()
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
- - Typically used after natives.requestModel to confirm readiness- Required before calling natives.createChar or spawning vehicles.
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.