engineRestreamModel | Multi Theft Auto: Wiki Skip to content

engineRestreamModel

Client-side
Server-side
Shared

Added in 1.6.0 r25613

This function re-streams a specific model by its ID. It can be used as a more efficient alternative to engineRestreamWorld when you only need to re-stream a single model. For example, after using engineImageLinkDFF, instead of calling engineRestreamWorld, you can call engineRestreamModel to re-stream only the replaced model, improving performance.

Note

This function works only on elements created by MTA. For example, objects created with createObject. If you want to re-stream elements that are part of the GTA map, you still need to use engineRestreamWorld.

Syntax

bool engineRestreamModel ( ​int modelId )
Required Arguments
  • modelId: The ID of the model you want to re-stream.

Returns

  • bool: result

The function returns true if the model was successfully re-streamed, and false otherwise.

Code Examples

client
-- Load IMG
local img = engineLoadIMG("file.img")
-- Enable streaming from this IMG
engineAddImage(img)
-- Get model TXD id
local infernusModelID = 411
local infernusModelTxdID = engineGetModelTXDID(infernusModelID)
-- Link DFF and TXD to IMG files
engineImageLinkDFF(img, "infernus.dff", infernusModelID)
engineImageLinkTXD(img, "infernus.txd", infernusModelTxdID)
-- Reload infernus model
engineRestreamModel(infernusModelID)

See Also

Engine Functions