engineImageLinkTXD | Multi Theft Auto: Wiki Skip to content

engineImageLinkTXD

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function links TXD file with an IMG container. This function does not change a model immediately. You should use engineRestreamWorld to reload models.

OOP Syntax Help! I don't understand this!

  • Method: img:linkTXD(...)

Syntax

boolean engineImageLinkTXD ( img img_file, string file_path, int txdID )
Required Arguments
  • img_file: The IMG file you want to link.
  • file_path: Path to the TXD file you want to link.
  • txdID: ID of the texture dictionary you want to link to. Use engineGetModelTXDID or engineRequestTXD to get this value.

Returns

  • boolean: value

Returns true if IMG file was successfully linked, false otherwise.

Code Examples

shared

You could use the following code:

-- 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 game models
engineRestreamWorld()

See Also

Engine Functions
Engine Elements