Streaming::requestModel: Difference between revisions
(yay) |
No edit summary |
||
| 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);</syntaxhighlight> | <syntaxhighlight lang="javascript">mp.game.streaming.requestModel(model[, cb]);</syntaxhighlight> | ||
=== Required Arguments === | === Required Arguments === | ||
*'''model:''' Model hash or name | *'''model:''' Model hash or name | ||
*'''callback:''' Function | |||
===Return value=== | ===Return value=== | ||
*'''Undefined''' | *'''Undefined''' | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
mp.game.streaming.requestModel("infernus", () => | |||
{ | |||
mp.gui.outputChatBox(`${mp.game.streaming.hasModelLoaded("infernus")} is true`); | |||
}); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See also== | ==See also== | ||
Revision as of 22:58, 24 May 2017
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(model[, cb]);
Required Arguments
- model: Model hash or name
- callback: Function
Return value
- Undefined
Example
mp.game.streaming.requestModel("infernus", () =>
{
mp.gui.outputChatBox(`${mp.game.streaming.hasModelLoaded("infernus")} is true`);
});