Streaming::requestModel: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
Request a model to be loaded into memory<br><br>Looking it the disassembly, it seems like it actually returns the model if it's already loaded.<br>
Request a model to be loaded into memory<br><br>Looking it the disassembly, it seems like it actually returns the model if it's already loaded.<br>
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">mp.game.streaming.requestModel(model[, cb]);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.streaming.requestModel(modelHash);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''model:''' Model hash or name
*'''model:''' Model hash
*'''callback:''' Function
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
mp.game.streaming.requestModel("infernus", () =>
mp.game.streaming.requestModel(mp.game.joaat('a_f_y_juggalo_01'));
{
    mp.gui.outputChatBox(`${mp.game.streaming.hasModelLoaded("infernus")} is true`);
});
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Streaming_s_function_c}}
{{Streaming_functions_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 03:35, 27 May 2024

Request a model to be loaded into memory

Looking it the disassembly, it seems like it actually returns the model if it's already loaded.

Syntax

mp.game.streaming.requestModel(modelHash);

Required Arguments

  • model: Model hash

Return value

  • Undefined

Example

mp.game.streaming.requestModel(mp.game.joaat('a_f_y_juggalo_01'));

See also