EngineImageGetFile

From Multi Theft Auto: Wiki
Revision as of 19:27, 10 April 2023 by TheNormalnij (talk | contribs) (Fix API description, add example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

ADDED/UPDATED IN VERSION 1.6.0 r21695:
This function gets a file from an IMG container.

Syntax

string engineImageGetFile ( img img_file, string/number file )


OOP Syntax Help! I don't understand this!

Method: img:getFile(...)


Required Arguments

  • img_file: The IMG file you want to get file from.
  • file: Name or position of the file you want to get.

Returns

Returns file's binary data if successful, false otherwise. Data size is bonded to 2 Kb block size.

Example

You could use the following code:

local img = engineLoadIMG( "file.img" )
local data = engineImageGetFile( img, 'test.dff' )
local dff = engineLoadDFF( data )
engineReplaceModel ( dff, 400 )


See Also