https://wiki.multitheftauto.com/api.php?action=feedcontributions&user=TheNormalnij&feedformat=atomMulti Theft Auto: Wiki - User contributions [en]2024-03-28T12:27:00ZUser contributionsMediaWiki 1.39.3https://wiki.multitheftauto.com/index.php?title=EngineImageLinkTXD&diff=78778EngineImageLinkTXD2024-01-18T15:45:58Z<p>TheNormalnij: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function links TXD file with an IMG container.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineImageLinkTXD ( img img_file, string file_path, int txdID )<br />
</syntaxhighlight><br />
<br />
{{OOP||[[img]]:linkTXD}}<br />
===Required Arguments===<br />
* '''img_file''': The [[IMG]] file you want to link.<br />
* '''file_path''': Path to the [[TXD]] file you want to link.<br />
* '''txdID''': ID of the texture dictionary you want to link to. Use [[engineGetModelTXDID]] or [[engineRequestTXD]] to get this value.<br />
<br />
===Returns===<br />
Returns ''true'' if [[IMG]] file was successfully linked, ''false'' otherwise.<br />
<br />
==Example==<br />
<br />
You could use the following code:<br />
<syntaxhighlight lang="lua"><br />
-- Load IMG<br />
local img = engineLoadIMG( "file.img" )<br />
<br />
-- Enable streaming from this IMG<br />
engineAddImage( img )<br />
<br />
-- Get model TXD id<br />
local infernusModelID = 411<br />
local infernusModelTxdID = engineGetModelTXDID( infernusModelID )<br />
<br />
-- Link DFF and TXD to IMG files<br />
engineImageLinkDFF( img, "infernus.dff", infernusModelID )<br />
engineImageLinkTXD( img, "infernus.txd", infernusModelTxdID )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineSetModelTXDID&diff=78573EngineSetModelTXDID2023-11-10T02:53:51Z<p>TheNormalnij: Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0161|1.6.0|22190|This function changes the TXD ID of the given model ID.}} ==Syntax== <syntaxhighlight lang="lua"> bool engineSetModelTXDID( int modelID, int txdID ) </syntaxhighlight> {{OOP||Engine.setModelTXDID}} ===Required Arguments=== *'''modelID:''' The ID of the model to update TXD ID. *'''txdID:''' The ID of target TXD. Use engineRequestTXD to get a new TXD ID. ===Returns=== Returns ''true'' if this fu..."</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{New feature/item|3.0161|1.6.0|22190|This function changes the TXD ID of the given model ID.}}<br />
<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool engineSetModelTXDID( int modelID, int txdID )<br />
</syntaxhighlight> <br />
{{OOP||Engine.setModelTXDID}}<br />
===Required Arguments=== <br />
*'''modelID:''' The ID of the model to update TXD ID.<br />
*'''txdID:''' The ID of target TXD. Use [[engineRequestTXD]] to get a new TXD ID.<br />
<br />
===Returns===<br />
Returns ''true'' if this function succeeds, throw a error if it fails for some reason.<br />
<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineGetModelTXDID&diff=78572EngineGetModelTXDID2023-11-10T02:45:31Z<p>TheNormalnij: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function gets TXD ID from a model.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
number engineGetModelTXDID ( number modelID )<br />
</syntaxhighlight><br />
<br />
{{OOP||Engine.getModelTXDID}}<br />
===Required Arguments===<br />
* '''modelID''': ID of the model you want to get TXD ID from.<br />
<br />
===Returns===<br />
Returns ID if successful, false otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineResetModelTXDID&diff=77590EngineResetModelTXDID2023-09-06T15:00:02Z<p>TheNormalnij: Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0161|1.6.0|22190|This function restores the original TXD ID of the given model ID. Reverses the effect of EngineSetModelTXDID.}} ==Syntax== <syntaxhighlight lang="lua"> bool engineResetModelTXDID( int modelID ) </syntaxhighlight> {{OOP||Engine.resetModelTXDID}} ===Required Arguments=== *'''modelID:''' The ID of the model to restore the model of ===Returns=== Returns ''true'' if this function succeeds, throw a..."</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
{{New feature/item|3.0161|1.6.0|22190|This function restores the original TXD ID of the given model ID. Reverses the effect of [[EngineSetModelTXDID]].}}<br />
<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
bool engineResetModelTXDID( int modelID )<br />
</syntaxhighlight> <br />
{{OOP||Engine.resetModelTXDID}}<br />
===Required Arguments=== <br />
*'''modelID:''' The ID of the model to restore the model of<br />
<br />
===Returns===<br />
Returns ''true'' if this function succeeds, throw a error if it fails for some reason.<br />
<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineFreeTXD&diff=77588EngineFreeTXD2023-09-03T18:26:39Z<p>TheNormalnij: Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0161|1.6.0|22190|This function is used to un-assign the specified TXD ID from the engineRequestTXD assignment.}} ==Syntax== <syntaxhighlight lang="lua"> bool engineFreeTXD ( int txdID ) </syntaxhighlight> ===Required Arguments=== *'''txdID''': the TXD ID you want to have un-assigned. ===Returns=== Returns ''true'' if the TXD was successfully freed, ''false'' otherwise. ==Example== <syntaxhighlight lang="lua"> -- T..."</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New feature/item|3.0161|1.6.0|22190|This function is used to un-assign the specified TXD ID from the [[engineRequestTXD]] assignment.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
bool engineFreeTXD ( int txdID )<br />
</syntaxhighlight><br />
===Required Arguments===<br />
*'''txdID''': the TXD ID you want to have un-assigned.<br />
<br />
===Returns===<br />
Returns ''true'' if the TXD was successfully freed, ''false'' otherwise.<br />
<br />
==Example==<br />
<syntaxhighlight lang="lua"><br />
-- TODO<br />
-- Allocate<br />
local newTxdId = engineRequestTXD("MYTEX")<br />
<br />
-- Remove<br />
engineFreeTXD(newTxdId)<br />
</syntaxhighlight><br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.6.0.22190|}}<br />
<br />
==See Also==<br />
{{Engine functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineRequestTXD&diff=77587EngineRequestTXD2023-09-03T18:21:09Z<p>TheNormalnij: fix new feature template</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New feature/item|3.0161|1.6.0|22190|This function is used to register the next available TXD ID.}}<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
int engineRequestTXD ( string name )<br />
</syntaxhighlight><br />
===Required Arguments===<br />
*'''name''': TXD name string up to 24 characters.<br />
<br />
===Returns===<br />
{{New feature/item|3.0160|1.6.0|22190| Returns an ''integer'' of the TXD ID that was available to be assigned to game models, ''false'' if no free TXD ID available.}}<br />
Do not rely on the id numbers returned being consistent across multiple clients or multiple runs of resources. There is no guarantee for the order of the numbers.<br />
<br />
==Example==<br />
This example replaces textures for some Grove Street buildings.<br />
<syntaxhighlight lang="lua"><br />
-- Load IMG archive<br />
local img = engineLoadIMG('worldmod.img')<br />
<br />
-- Enable streaming from this IMG<br />
engineAddImage(img)<br />
<br />
-- Allocate a new TXD<br />
local newTxdId = engineRequestTXD("WESTERNHOUSES01")<br />
<br />
-- Link IMG files to TXD<br />
engineImageLinkTXD(img, "western.txd", newTxdId)<br />
<br />
-- Assign TXD to game models<br />
engineSetModelTXTID(17697, newTxdId)<br />
engineSetModelTXTID(17925, newTxdId)<br />
engineSetModelTXTID(3646, newTxdId)<br />
</syntaxhighlight><br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.6.0-22190|}}<br />
<br />
==See Also==<br />
{{Engine functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineRequestTXD&diff=77586EngineRequestTXD2023-09-03T17:04:53Z<p>TheNormalnij: Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0160|1.6.0|22190|This function is used to register the next available TXD ID.}} ==Syntax== <syntaxhighlight lang="lua"> int engineRequestTXD ( string name ) </syntaxhighlight> ===Required Arguments=== *'''name''': TXD name string up to 24 characters. ===Returns=== {{New feature/item|3.0160|1.6.0|22190| Returns an ''integer'' of the TXD ID that was available to be assigned to game models, ''false'' if no free TXD ID avai..."</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New feature/item|3.0160|1.6.0|22190|This function is used to register the next available TXD ID.}}<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
int engineRequestTXD ( string name )<br />
</syntaxhighlight><br />
===Required Arguments===<br />
*'''name''': TXD name string up to 24 characters.<br />
<br />
===Returns===<br />
{{New feature/item|3.0160|1.6.0|22190| Returns an ''integer'' of the TXD ID that was available to be assigned to game models, ''false'' if no free TXD ID available.}}<br />
Do not rely on the id numbers returned being consistent across multiple clients or multiple runs of resources. There is no guarantee for the order of the numbers.<br />
<br />
==Example==<br />
This example replaces textures for some Grove Street buildings.<br />
<syntaxhighlight lang="lua"><br />
-- Load IMG archive<br />
local img = engineLoadIMG('worldmod.img')<br />
<br />
-- Enable streaming from this IMG<br />
engineAddImage(img)<br />
<br />
-- Allocate a new TXD<br />
local newTxdId = engineRequestTXD("WESTERNHOUSES01")<br />
<br />
-- Link IMG files to TXD<br />
engineImageLinkTXD(img, "western.txd", newTxdId)<br />
<br />
-- Assign TXD to game models<br />
engineSetModelTXTID(17697, newTxdId)<br />
engineSetModelTXTID(17925, newTxdId)<br />
engineSetModelTXTID(3646, newTxdId)<br />
</syntaxhighlight><br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.6.0-22190|}}<br />
<br />
==See Also==<br />
{{Engine functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=Template:Engine_functions&diff=77543Template:Engine functions2023-09-01T13:00:14Z<p>TheNormalnij: Add new txd functions from r22190</p>
<hr />
<div><ul><br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
<li>[[engineAddImage]]</li><br />
}}<br />
<li>[[engineApplyShaderToWorldTexture]]</li><br />
<li>[[engineFreeModel]]</li><br />
{{Added feature/item|1.6.1|1.6.0|22190|<br />
<li>[[engineFreeTXD]]</li><br />
}}<br />
{{Added feature/item|1.6.0|1.5.9|21695|<br />
<li>[[engineGetModelFlags]]</li><br />
}}<br />
<li>[[engineGetModelIDFromName]]</li><br />
<li>[[engineGetModelLODDistance]]</li><br />
<li>[[engineGetModelNameFromID]]</li><br />
<li>[[engineGetModelPhysicalPropertiesGroup]]</li><br />
<li>[[engineGetModelTextureNames]]</li><br />
<li>[[engineGetModelTextures]]</li><br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
<li>[[engineGetModelTXDID]]</li><br />
}}<br />
{{Added feature/item|1.5.9|1.5.8|20704|<br />
<li>[[engineGetModelVisibleTime]]</li><br />
}}<br />
<li>[[engineGetObjectGroupPhysicalProperty]]</li><br />
<li>[[engineGetSurfaceProperties]]</li><br />
<li>[[engineGetVisibleTextureNames]]</li><br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
<li>[[engineImageGetFilesCount]]</li><br />
<li>[[engineImageGetFiles]]</li><br />
<li>[[engineImageGetFile]]</li><br />
<li>[[engineImageLinkDFF]]</li><br />
<li>[[engineImageLinkTXD]]</li><br />
}}<br />
<li>[[engineImportTXD]]</li><br />
<li>[[engineLoadCOL]]</li><br />
<li>[[engineLoadDFF]]</li><br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
<li>[[engineLoadIMG]]</li><br />
}}<br />
<li>[[engineLoadIFP]]</li><br />
<li>[[engineLoadTXD]]</li><br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
<li>[[engineRemoveImage]]</li><br />
}}<br />
<li>[[engineRemoveShaderFromWorldTexture]]</li><br />
<li>[[engineReplaceAnimation]]</li><br />
<li>[[engineReplaceCOL]]</li><br />
<li>[[engineReplaceModel]]</li><br />
<li>[[engineRequestModel]]</li><br />
{{Added feature/item|1.6.1|1.6.0|22190|<br />
<li>[[engineRequestTXD]]</li><br />
}}<br />
{{Added feature/item|1.6.0|1.5.9|21695|<br />
<li>[[engineResetModelFlags]]</li><br />
}}<br />
<li>[[engineResetModelLODDistance]]</li><br />
{{Added feature/item|1.6.1|1.6.0|22190|<br />
<li>[[engineResetModelTXDID]]</li><br />
}}<br />
<li>[[engineResetSurfaceProperties]]</li><br />
<li>[[engineRestoreAnimation]]</li><br />
<li>[[engineRestoreCOL]]</li><br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
<li>[[engineRestoreDFFImage]]</li><br />
}}<br />
<li>[[engineRestoreModel]]</li><br />
<li>[[engineRestoreModelPhysicalPropertiesGroup]]</li><br />
<li>[[engineRestoreObjectGroupPhysicalProperties]]</li><br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
<li>[[engineRestoreTXDImage]]</li><br />
}}<br />
{{Added feature/item|1.5.9|1.5.8|20704|<br />
<li>[[engineRestreamWorld]]</li><br />
}}<br />
<li>[[engineSetAsynchronousLoading]]</li><br />
{{Added feature/item|1.6.0|1.5.9|21695|<br />
<li>[[engineSetModelFlag]]</li><br />
<li>[[engineSetModelFlags]]</li><br />
}}<br />
<li>[[engineSetModelLODDistance]]</li><br />
<li>[[engineSetModelPhysicalPropertiesGroup]]</li><br />
{{Added feature/item|1.6.1|1.6.0|22190|<br />
<li>[[engineSetModelTXDID]]</li><br />
}}<br />
{{Added feature/item|1.5.9|1.5.8|20704|<br />
<li>[[engineSetModelVisibleTime]]</li><br />
}}<br />
<li>[[engineSetObjectGroupPhysicalProperty]]</li><br />
<li>[[engineSetSurfaceProperties]]</li><br />
{{Added feature/item|1.5.9|1.5.8|20901|<br />
<li>[[engineStreamingFreeUpMemory]]</li><br />
<li>[[engineStreamingGetUsedMemory]]</li><br />
}}<br />
</ul><br />
<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=Template:Engine_functions&diff=77236Template:Engine functions2023-07-31T18:32:49Z<p>TheNormalnij: Add model flags functions</p>
<hr />
<div>{{Added feature/item|1.6.0|1.5.9|21708|<br />
* [[engineAddImage]]<br />
}}<br />
* [[engineApplyShaderToWorldTexture]]<br />
* [[engineFreeModel]]<br />
{{Added feature/item|1.6.0|1.5.9|21695|<br />
* [[engineGetModelFlags]]<br />
}}<br />
* [[engineGetModelIDFromName]]<br />
* [[engineGetModelLODDistance]]<br />
* [[engineGetModelNameFromID]]<br />
* [[engineGetModelPhysicalPropertiesGroup]]<br />
* [[engineGetModelTextureNames]]<br />
* [[engineGetModelTextures]]<br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
* [[engineGetModelTXDID]]<br />
}}<br />
{{Added feature/item|1.5.9|1.5.8|20704|<br />
* [[engineGetModelVisibleTime]]<br />
}}<br />
* [[engineGetObjectGroupPhysicalProperty]]<br />
* [[engineGetSurfaceProperties]]<br />
* [[engineGetVisibleTextureNames]]<br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
* [[engineImageGetFilesCount]]<br />
* [[engineImageGetFiles]]<br />
* [[engineImageGetFile]]<br />
* [[engineImageLinkDFF]]<br />
* [[engineImageLinkTXD]]<br />
}}<br />
* [[engineImportTXD]]<br />
* [[engineLoadCOL]]<br />
* [[engineLoadDFF]]<br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
* [[engineLoadIMG]]<br />
}}<br />
* [[engineLoadIFP]]<br />
* [[engineLoadTXD]]<br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
* [[engineRemoveImage]]<br />
}}<br />
* [[engineRemoveShaderFromWorldTexture]]<br />
* [[engineReplaceAnimation]]<br />
* [[engineReplaceCOL]]<br />
* [[engineReplaceModel]]<br />
* [[engineRequestModel]]<br />
{{Added feature/item|1.6.0|1.5.9|21695|<br />
* [[engineResetModelFlags]]<br />
}}<br />
* [[engineResetModelLODDistance]]<br />
* [[engineResetSurfaceProperties]]<br />
* [[engineRestoreAnimation]]<br />
* [[engineRestoreCOL]]<br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
* [[engineRestoreDFFImage]]<br />
}}<br />
* [[engineRestoreModel]]<br />
* [[engineRestoreModelPhysicalPropertiesGroup]]<br />
* [[engineRestoreObjectGroupPhysicalProperties]]<br />
{{Added feature/item|1.6.0|1.5.9|21708|<br />
* [[engineRestoreTXDImage]]<br />
}}<br />
{{Added feature/item|1.5.9|1.5.8|20704|<br />
* [[engineRestreamWorld]]<br />
}}<br />
* [[engineSetAsynchronousLoading]]<br />
{{Added feature/item|1.6.0|1.5.9|21695|<br />
* [[engineSetModelFlag]]<br />
* [[engineSetModelFlags]]<br />
}}<br />
* [[engineSetModelLODDistance]]<br />
* [[engineSetModelPhysicalPropertiesGroup]]<br />
{{Added feature/item|1.5.9|1.5.8|20704|<br />
* [[engineSetModelVisibleTime]]<br />
}}<br />
* [[engineSetObjectGroupPhysicalProperty]]<br />
* [[engineSetSurfaceProperties]]<br />
{{Added feature/item|1.5.9|1.5.8|20901|<br />
* [[engineStreamingFreeUpMemory]]<br />
* [[engineStreamingGetUsedMemory]]<br />
}}<br />
<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineSetModelFlag&diff=77184EngineSetModelFlag2023-07-21T16:57:02Z<p>TheNormalnij: </p>
<hr />
<div>{{Client function}}<br />
__NOTOC__<br />
<br />
{{New feature/item|4|1.6.0|21695|This function changes specific [[Model flags|model flag]].}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineSetModelFlag( int modelID, string flagName, bool state )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''modelID''': ID of the model you want to set flag.<br />
* '''flagName''': [[Model flags|flag name]].<br />
* '''state''': flag state.<br />
<br />
===Returns===<br />
Returns ''boolean'' with flag state, throws an error otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineSetModelFlag&diff=76715EngineSetModelFlag2023-04-16T20:36:52Z<p>TheNormalnij: Created page with "__NOTOC__ {{Client function}} {{New feature/item|4|1.6.0|21695|This function changes specific model flag.}} ==Syntax== <syntaxhighlight lang="lua"> boolean engineSetModelFlag( int modelID, string flagName, bool state ) </syntaxhighlight> ===Required Arguments=== * '''modelID''': ID of the model you want to set flag. * '''flagName''': flag name. * '''state''': flag state. ===Returns=== Returns ''boolean'' with flag state, throws an erro..."</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function changes specific [[Model flags|model flag]].}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineSetModelFlag( int modelID, string flagName, bool state )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''modelID''': ID of the model you want to set flag.<br />
* '''flagName''': [[Model flags|flag name]].<br />
* '''state''': flag state.<br />
<br />
===Returns===<br />
Returns ''boolean'' with flag state, throws an error otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineGetModelFlag&diff=76714EngineGetModelFlag2023-04-16T19:19:00Z<p>TheNormalnij: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function returns specific [[Model flags|model flag]].}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineGetModelFlag( int modelID, string flagName )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''modelID''': ID of the model you want to get flags.<br />
* '''flagName''': [[Model flags|flag name]].<br />
<br />
===Returns===<br />
Returns ''true'' if flag enabled, ''false'' otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineGetModelFlag&diff=76713EngineGetModelFlag2023-04-16T19:18:46Z<p>TheNormalnij: Created page with "__NOTOC__ {{Client function}} {{New feature/item|4|1.6.0|21695|This function returns specific model flag.}} ==Syntax== <syntaxhighlight lang="lua"> boolean engineGetModelFlags( int modelID, string flagName ) </syntaxhighlight> ===Required Arguments=== * '''modelID''': ID of the model you want to get flags. * '''flagName''': flag name. ===Returns=== Returns ''true'' if flag enabled, ''false'' otherwise. ==See Also== {{Engine_functions}}"</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function returns specific [[Model flags|model flag]].}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineGetModelFlags( int modelID, string flagName )<br />
</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''modelID''': ID of the model you want to get flags.<br />
* '''flagName''': [[Model flags|flag name]].<br />
<br />
===Returns===<br />
Returns ''true'' if flag enabled, ''false'' otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineGetModelFlags&diff=76712EngineGetModelFlags2023-04-16T19:12:06Z<p>TheNormalnij: Created page with "__NOTOC__ {{Client function}} {{New feature/item|4|1.6.0|21695|This function returns model flags.}} ==Syntax== <syntaxhighlight lang="lua"> int engineGetModelFlags( int modelID ) </syntaxhighlight> {{OOP||Engine.getModelFlags}} ===Required Arguments=== * '''modelID''': ID of the model you want to get flags. ===Returns=== Returns ''int'' with model flags in GTA format, throws an error otherwise. ==See Also== {{Engine_functions}}"</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function returns [[Model flags|model flags]].}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
int engineGetModelFlags( int modelID )<br />
</syntaxhighlight><br />
<br />
{{OOP||Engine.getModelFlags}}<br />
===Required Arguments===<br />
* '''modelID''': ID of the model you want to get flags.<br />
<br />
===Returns===<br />
Returns ''int'' with model flags in GTA format, throws an error otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineSetModelFlags&diff=76711EngineSetModelFlags2023-04-16T19:08:37Z<p>TheNormalnij: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function changes [[Model flags|model flags]].}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineSetModelFlags( int modelID, int flags [, bool ideFlags] )<br />
</syntaxhighlight><br />
<br />
{{OOP||Engine.setModelFlags}}<br />
===Required Arguments===<br />
* '''modelID''': ID of the model you want to change.<br />
* '''flags''': flags.<br />
<br />
===Optional Arguments===<br />
{{OptionalArg}}<br />
* '''ideFlags''': use IDE flag format.<br />
<br />
===Returns===<br />
Returns ''true'' if model flags was successfully changed, ''false'' otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineSetModelFlags&diff=76710EngineSetModelFlags2023-04-16T19:05:52Z<p>TheNormalnij: Created page with "__NOTOC__ {{Client function}} {{New feature/item|4|1.6.0|21695|This function changes model flags.}} ==Syntax== <syntaxhighlight lang="lua"> boolean engineSetModelFlags( int modelID, int flags [, bool ideFlags] ) </syntaxhighlight> {{OOP||Engine.setModelFlags}} ===Required Arguments=== * '''modelID''': ID of the model you want to change. * '''flags''': flags. ===Optional Arguments=== {{OptionalArg}} * '''ideFlags''': use IDE flag format. ===Returns=== Returns ''true'..."</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function changes model flags.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineSetModelFlags( int modelID, int flags [, bool ideFlags] )<br />
</syntaxhighlight><br />
<br />
{{OOP||Engine.setModelFlags}}<br />
===Required Arguments===<br />
* '''modelID''': ID of the model you want to change.<br />
* '''flags''': flags.<br />
<br />
===Optional Arguments===<br />
{{OptionalArg}}<br />
* '''ideFlags''': use IDE flag format.<br />
<br />
===Returns===<br />
Returns ''true'' if model flags was successfully changed, ''false'' otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineResetModelFlags&diff=76709EngineResetModelFlags2023-04-16T18:48:22Z<p>TheNormalnij: Created page with "__NOTOC__ {{Client function}} {{New feature/item|4|1.6.0|21695|This function restores model flags to default state.}} ==Syntax== <syntaxhighlight lang="lua"> boolean engineResetModelFlags( int modelID ) </syntaxhighlight> {{OOP||Engine.resetModelFlags}} ===Required Arguments=== * '''modelID''': ID of the model you want to reset. ===Returns=== Returns ''true'' if model flags was successfully restored, ''false'' otherwise. ==See Also== {{Engine_functions}}"</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function restores model flags to default state.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineResetModelFlags( int modelID )<br />
</syntaxhighlight><br />
<br />
{{OOP||Engine.resetModelFlags}}<br />
===Required Arguments===<br />
* '''modelID''': ID of the model you want to reset.<br />
<br />
===Returns===<br />
Returns ''true'' if model flags was successfully restored, ''false'' otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineRemoveImage&diff=76708EngineRemoveImage2023-04-16T18:13:52Z<p>TheNormalnij: Fix description</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21708|This function disables streaming from an IMG container.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineRemoveImage ( img img_file )<br />
</syntaxhighlight><br />
<br />
{{OOP||[[img]]:remove}}<br />
===Required Arguments===<br />
* '''img_file''': The [[IMG]] file you want to remove.<br />
<br />
===Returns===<br />
Returns ''true'' if stremaing from [[IMG]] file was successfully disabled, ''false'' otherwise.<br />
<br />
==Examples==<br />
This example loads IMG file, adds it to GTA and after 10 seconds removes it.<br />
<syntaxhighlight lang="lua"><br />
local img = engineLoadIMG('file.img') -- load IMG file to mta<br />
engineAddImage(img) -- add it to GTA world<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineAddImage&diff=76707EngineAddImage2023-04-16T18:12:04Z<p>TheNormalnij: Fix OOP</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function adds an IMG file container to GTA streamer. After this GTA will asynchronously load models from IMG. '''Only two additional archives can be enabled once'''}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineAddImage ( img imgArchive )<br />
</syntaxhighlight><br />
<br />
{{OOP||[[img]]:add}}<br />
===Required Arguments===<br />
* '''imgArchive''': The [[IMG]] file you want to add to GTA world.<br />
<br />
===Returns===<br />
Returns true if the [[IMG]] element was successfully added, ''false'' otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineAddImage&diff=76691EngineAddImage2023-04-10T20:10:00Z<p>TheNormalnij: fix OOP</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function adds an IMG file container to GTA streamer. After this GTA will asynchronously load models from IMG. '''Only two additional archives can be enabled once'''}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineAddImage ( img imgArchive )<br />
</syntaxhighlight><br />
<br />
{{OOP||[[img]]:add}}<br />
===Required Arguments===<br />
* '''imgArchive''': The [[IMG]] file you want to add to GTA world.<br />
<br />
===Returns===<br />
Returns true if the [[IMG]] element was successfully added, ''false'' otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineImageLinkTXD&diff=76690EngineImageLinkTXD2023-04-10T20:09:12Z<p>TheNormalnij: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function links TXD file with an IMG container.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineImageLinkTXD ( img img_file, string file_path, int modelID )<br />
</syntaxhighlight><br />
<br />
{{OOP||[[img]]:linkTXD}}<br />
===Required Arguments===<br />
* '''img_file''': The [[IMG]] file you want to link.<br />
* '''file_path''': Path to the [[TXD]] file you want to link.<br />
* '''modelID''': ID of the model you want to link to.<br />
<br />
===Returns===<br />
Returns ''true'' if [[IMG]] file was successfully linked, ''false'' otherwise.<br />
<br />
==Example==<br />
<br />
You could use the following code:<br />
<syntaxhighlight lang="lua"><br />
-- Load IMG<br />
local img = engineLoadIMG( "file.img" )<br />
<br />
-- Enable streaming from this IMG<br />
engineAddImage( img )<br />
<br />
-- Get model TXD id<br />
local infernusModelID = 411<br />
local infernusModelTxdID = engineGetModelTXDID( infernusModelID )<br />
<br />
-- Link DFF and TXD to IMG files<br />
engineImageLinkDFF( img, "infernus.dff", infernusModelID )<br />
engineImageLinkTXD( img, "infernus.txd", infernusModelTxdID )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineImageLinkDFF&diff=76689EngineImageLinkDFF2023-04-10T20:04:45Z<p>TheNormalnij: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function links DFF file with an IMG container.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineImageLinkDFF ( img img_file, string file_path, int modelID )<br />
</syntaxhighlight><br />
<br />
{{OOP||[[img]]:linkDFF}}<br />
===Required Arguments===<br />
* '''img_file''': The [[IMG]] file you want to link.<br />
* '''file_path''': Path to the [[DFF]] file you want to link.<br />
* '''modelID''': ID of the model you want to link to.<br />
<br />
===Returns===<br />
Returns ''true'' if [[IMG]] file was successfully linked, ''false'' otherwise.<br />
<br />
==Example==<br />
<br />
You could use the following code:<br />
<syntaxhighlight lang="lua"><br />
-- Load IMG<br />
local img = engineLoadIMG( "file.img" )<br />
<br />
-- Enable streaming from this IMG<br />
engineAddImage( img )<br />
<br />
-- Get model TXD id<br />
local infernusModelID = 411<br />
local infernusModelTxdID = engineGetModelTXDID( infernusModelID )<br />
<br />
-- Link DFF and TXD to IMG files<br />
engineImageLinkDFF( img, "infernus.dff", infernusModelID )<br />
engineImageLinkTXD( img, "infernus.txd", infernusModelTxdID )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineImageLinkDFF&diff=76688EngineImageLinkDFF2023-04-10T19:50:16Z<p>TheNormalnij: Fix API description, add example</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function links DFF file with an IMG container.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineImageLinkDFF ( img img_file, string file_path, int modelID )<br />
</syntaxhighlight><br />
<br />
{{OOP||[[img]]:linkDFF}}<br />
===Required Arguments===<br />
* '''img_file''': The [[IMG]] file you want to link.<br />
* '''file_path''': Path to the [[DFF]] file you want to link.<br />
* '''modelID''': ID of the model you want to link to.<br />
<br />
===Returns===<br />
Returns ''true'' if [[IMG]] file was successfully linked, ''false'' otherwise.<br />
<br />
==Example==<br />
<br />
You could use the following code:<br />
<syntaxhighlight lang="lua"><br />
-- Load IMG<br />
local img = engineLoadIMG( "file.img" )<br />
-- Enable streaming from this IMG<br />
engineAddImage( img )<br />
<br />
-- Get model TXD id<br />
local infernusModelID = 411<br />
local infernusModelTxdID = engineGetModelTXDID( infernusModelID )<br />
<br />
-- Link DFF and TXD to IMG files<br />
engineImageLinkDFF( img, "infernus.dff", infernusModelID )<br />
engineImageLinkTXD( img, "infernus.txd", infernusModelTxdID )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineImageGetFiles&diff=76687EngineImageGetFiles2023-04-10T19:39:35Z<p>TheNormalnij: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function gets the list of files from an IMG container.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
table engineImageGetFiles ( img imgArchive )<br />
</syntaxhighlight><br />
<br />
{{OOP||[[img]]:getFiles|files}}<br />
===Required Arguments===<br />
* '''imgArchive''': The [[IMG]] file handler you want to get files from.<br />
<br />
===Returns===<br />
Returns array table with files in the [[IMG]] element if successfull, false otherwise.<br />
<br />
==Example==<br />
<br />
You could use the following code:<br />
<syntaxhighlight lang="lua"><br />
local img = engineLoadIMG( "file.img" )<br />
local filesInArchive = engineImageGetFiles( img )<br />
<br />
outputChatBox("'file.img' contains files:")<br />
for fileId = 1, #filesInArchive do<br />
outputChatBox(fileId .. ": " .. filesInArchive[i])<br />
end<br />
</syntaxhighlight><br />
<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineImageGetFiles&diff=76686EngineImageGetFiles2023-04-10T19:39:19Z<p>TheNormalnij: Fix description. Add example</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function gets the list of files from an IMG container.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
table engineImageGetFiles ( img imgArchive )<br />
</syntaxhighlight><br />
<br />
{{OOP||[[IMG]]:getFiles|files}}<br />
===Required Arguments===<br />
* '''imgArchive''': The [[IMG]] file handler you want to get files from.<br />
<br />
===Returns===<br />
Returns array table with files in the [[IMG]] element if successfull, false otherwise.<br />
<br />
==Example==<br />
<br />
You could use the following code:<br />
<syntaxhighlight lang="lua"><br />
local img = engineLoadIMG( "file.img" )<br />
local filesInArchive = engineImageGetFiles( img )<br />
<br />
outputChatBox("'file.img' contains files:")<br />
for fileId = 1, #filesInArchive do<br />
outputChatBox(fileId .. ": " .. filesInArchive[i])<br />
end<br />
</syntaxhighlight><br />
<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineImageGetFilesCount&diff=76685EngineImageGetFilesCount2023-04-10T19:30:27Z<p>TheNormalnij: Add variable param</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
This function returns the number of files an IMG file has.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
int engineImageGetFilesCount ( img imgArchive )<br />
</syntaxhighlight> <br />
{{OOP||[[img]]:getFilesCount|filesCount}}<br />
<br />
===Required Arguments=== <br />
*'''imgArchive:''' the IMG archive handler<br />
<br />
===Returns===<br />
Returns an ''int'' with the number of files.<br />
<br />
==Example==<br />
<br />
You could use the following code:<br />
<syntaxhighlight lang="lua"><br />
local img = engineLoadIMG( "file.img" )<br />
local count = engineImageGetFilesCount( img )<br />
outputChatBox("'file.img' has " .. count .. " files")<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Engine_functions}}<br />
<br />
[[Category:Changes in 1.6.0]]</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineImageGetFile&diff=76684EngineImageGetFile2023-04-10T19:27:52Z<p>TheNormalnij: Fix API description, add example</p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function gets a file from an IMG container.}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
string engineImageGetFile ( img img_file, string/number file )<br />
</syntaxhighlight><br />
<br />
{{OOP||[[img]]:getFile||}}<br />
===Required Arguments===<br />
* '''img_file''': The [[IMG]] file you want to get file from.<br />
* '''file''': Name or position of the file you want to get.<br />
<br />
===Returns===<br />
Returns file's binary data if successful, false otherwise. Data size is bonded to 2 Kb block size.<br />
<br />
==Example==<br />
<br />
You could use the following code:<br />
<syntaxhighlight lang="lua"><br />
local img = engineLoadIMG( "file.img" )<br />
local data = engineImageGetFile( img, 'test.dff' )<br />
local dff = engineLoadDFF( data )<br />
engineReplaceModel ( dff, 400 )<br />
</syntaxhighlight><br />
<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineAddImage&diff=76683EngineAddImage2023-04-10T19:12:16Z<p>TheNormalnij: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function adds an IMG file container to GTA streamer. After this GTA will asynchronously load models from IMG. '''Only two additional archives can be enabled once'''}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineAddImage ( img imgArchive )<br />
</syntaxhighlight><br />
<br />
{{OOP||[[DFF|EngineIMG]]}}<br />
===Required Arguments===<br />
* '''imgArchive''': The [[IMG]] file you want to add to GTA world.<br />
<br />
===Returns===<br />
Returns true if the [[IMG]] element was successfully added, ''false'' otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineAddImage&diff=76682EngineAddImage2023-04-10T19:11:53Z<p>TheNormalnij: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
<br />
{{New feature/item|4|1.6.0|21695|This function adds an IMG file container to GTA streamer. After this GTA will asynchronously load models from IMG. '''Only two additional archives can be enabled once```}}<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
boolean engineAddImage ( img imgArchive )<br />
</syntaxhighlight><br />
<br />
{{OOP||[[DFF|EngineIMG]]}}<br />
===Required Arguments===<br />
* '''imgArchive''': The [[IMG]] file you want to add to GTA world.<br />
<br />
===Returns===<br />
Returns true if the [[IMG]] element was successfully added, ''false'' otherwise.<br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineImageGetFilesCount&diff=76654EngineImageGetFilesCount2023-04-10T15:33:25Z<p>TheNormalnij: added Category:Changes in 1.6.0 using HotCat</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
This function returns the number of files an IMG file has.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
int engineImageGetFilesCount ( img imgArchive )<br />
</syntaxhighlight> <br />
{{OOP||[[img]]:getFilesCount||}}<br />
<br />
===Required Arguments=== <br />
*'''imgArchive:''' the IMG archive handler<br />
<br />
===Returns===<br />
Returns an ''int'' with the number of files.<br />
<br />
==Example==<br />
<br />
You could use the following code:<br />
<syntaxhighlight lang="lua"><br />
local img = engineLoadIMG( "file.img" )<br />
local count = engineImageGetFilesCount( img )<br />
outputChatBox("'file.img' has " .. count .. " files")<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Engine_functions}}<br />
<br />
[[Category:Changes in 1.6.0]]</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineImageGetFilesCount&diff=76653EngineImageGetFilesCount2023-04-10T15:33:13Z<p>TheNormalnij: removed Category:Changes in 1.6.0 using HotCat</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
This function returns the number of files an IMG file has.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
int engineImageGetFilesCount ( img imgArchive )<br />
</syntaxhighlight> <br />
{{OOP||[[img]]:getFilesCount||}}<br />
<br />
===Required Arguments=== <br />
*'''imgArchive:''' the IMG archive handler<br />
<br />
===Returns===<br />
Returns an ''int'' with the number of files.<br />
<br />
==Example==<br />
<br />
You could use the following code:<br />
<syntaxhighlight lang="lua"><br />
local img = engineLoadIMG( "file.img" )<br />
local count = engineImageGetFilesCount( img )<br />
outputChatBox("'file.img' has " .. count .. " files")<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineImageGetFilesCount&diff=76652EngineImageGetFilesCount2023-04-10T15:32:54Z<p>TheNormalnij: added Category:Changes in 1.6.0 using HotCat</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
This function returns the number of files an IMG file has.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
int engineImageGetFilesCount ( img imgArchive )<br />
</syntaxhighlight> <br />
{{OOP||[[img]]:getFilesCount||}}<br />
<br />
===Required Arguments=== <br />
*'''imgArchive:''' the IMG archive handler<br />
<br />
===Returns===<br />
Returns an ''int'' with the number of files.<br />
<br />
==Example==<br />
<br />
You could use the following code:<br />
<syntaxhighlight lang="lua"><br />
local img = engineLoadIMG( "file.img" )<br />
local count = engineImageGetFilesCount( img )<br />
outputChatBox("'file.img' has " .. count .. " files")<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Engine_functions}}<br />
<br />
[[Category:Changes in 1.6.0]]</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineImageGetFilesCount&diff=76651EngineImageGetFilesCount2023-04-10T15:27:11Z<p>TheNormalnij: Created page with "__NOTOC__ {{Client function}} This function returns the number of files an IMG file has. ==Syntax== <syntaxhighlight lang="lua"> int engineImageGetFilesCount ( img imgArchive ) </syntaxhighlight> {{OOP||img:getFilesCount||}} ===Required Arguments=== *'''imgArchive:''' the IMG archive handler ===Returns=== Returns an ''int'' with the number of files. ==Example== You could use the following code: <syntaxhighlight lang="lua"> local img = engineLoadIMG( "file.im..."</p>
<hr />
<div>__NOTOC__ <br />
{{Client function}}<br />
This function returns the number of files an IMG file has.<br />
<br />
==Syntax== <br />
<syntaxhighlight lang="lua"><br />
int engineImageGetFilesCount ( img imgArchive )<br />
</syntaxhighlight> <br />
{{OOP||[[img]]:getFilesCount||}}<br />
<br />
===Required Arguments=== <br />
*'''imgArchive:''' the IMG archive handler<br />
<br />
===Returns===<br />
Returns an ''int'' with the number of files.<br />
<br />
==Example==<br />
<br />
You could use the following code:<br />
<syntaxhighlight lang="lua"><br />
local img = engineLoadIMG( "file.img" )<br />
local count = engineImageGetFilesCount( img )<br />
outputChatBox("'file.img' has " .. count .. " files")<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Engine_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=Client_on_Linux_Manual&diff=73327Client on Linux Manual2022-01-04T22:34:33Z<p>TheNormalnij: /* Known issues */ Added cef workaround link</p>
<hr />
<div>{{Needs Checking|MTA:SA support on Linux is on a best-effort basis, and you can run into a long list of issues. Also see "Known issues" paragraph}}<br />
{{Warning|This page is for Linux players '''ONLY''', for Windows go [[Client Manual|here]].|true}}<br />
<br />
==Lutris==<br />
<br />
Lutris can be used instead for easier Prefix management, see<br />
[[Client on Linux using Lutris Manual]]<br />
<br />
==Before you start==<br />
<br />
First of all, please ensure your computer fits the requirements needed.<br />
Read the [[Client_Manual|Client Manual]] page for further informations, or join us on [https://mtasa.com/discord Discord].<br />
<br />
During this tutorial, make sure to '''only use 32-bit Wine prefix''' for MTA:SA, or else you'll run into a plethora of hard-to-fix issues.<br />
<br />
===Requirements===<br />
The hardware requirements for Multi Theft Auto: San Andreas are the same as on Windows.<br />
For software requirements, you need:<br />
* Wine (get it on your package manager (synaptic, apt, pacman, yum, etc.); follow instructions [https://www.winehq.org/download/ubuntu here] if you're using Ubuntu<br />
(as of MTA 1.4.1 Ubuntu's default Wine package seems to be incompatible with Visual C++, which is required to install MTA)<br />
* Windows fonts installed:<br />
** tahoma.ttf<br />
** tahomabd.ttf<br />
** verdana.ttf<br />
Get them on the Internet, e.g. [http://fontonic.com/ fontonic.com]<br />
<br />
Or get the zip archive with the 3 fonts {{WineFonts}}.<br />
<br />
Install them in: <syntaxhighlight lang="lua">~/.wine/dosdevices/c:/windows/Fonts/</syntaxhighlight><br />
(~/ points to your user home folder on Linux, .wine is the default wineprefix)<br />
<br />
==Installing the game==<br />
Download the MTA installer from [http://www.mtasa.com mtasa.com], ensure you can launch it (chmod +x) then install it when you want.<br><br />
'''Make sure to only use 32-bit Wine prefix for MTA:SA, or else you'll run into a plethora of hard-to-fix issues.'''<br />
<br />
==Running the game==<br />
Once installed, double-clicking on the Multi Theft Auto.exe should work. If not, try in a terminal the following command: "wine Multi Theft Auto.exe" in the directory you installed Multi Theft Auto to.<br />
If it doesn't work, check the contents of the file c:/Program_Files/Multi Theft Auto/MTA/CEGUI.log, which may contain useful information.<br />
<br />
===Known issues===<br />
* MTA isn't starting (even with fonts installed)<br />
#Try to start MTA:SA in a virtual desktop<br />
#:Go to WineConfig, choose the tab "Graphics" and select "Emulate a virtual desktop".<br><br />
#Try to delete your gta_sa.set file<br />
#:which is located in the "GTA San Andreas User Files" folder, which can be found in your home directory.<br>'''(Remember to create a copy, if you're playing San Andreas in singleplayer)'''<br />
#Try to delete your MTA config file<br />
#:which is: "MTA San Andreas 1.3/MTA/coreconfig.xml"<br>'''(Also remember to create a copy, if you don't want to lose your edited MTA configuration)'''<br />
* MTA won't start on Ubuntu 12.04 LTS [Temporary fix is available [https://forum.mtasa.com/topic/36206-mta-13-wont-start-on-ubuntu-1204/#comment-366248 here]. Although, just updating away from such an old version of Ubuntu is the recommended way to go]<br />
<br />
* "SD #16 Error" when connecting to a server<br />
* "No audio card detected" when launching either GTA:SA or MTA<br />
* Using standard Full-screen mode on MTA might cause some occasional artifacts<br />
* Enabling DXVK might not break GTA:SA, but it breaks MTA<br />
* Using Linux brings a higher-than-usual chance for game crashes due to various reasons (sometimes to do with resources & mods on individual servers)<br />
* CEF crashes with some wine versions. Use [https://github.com/multitheftauto/mtasa-blue/issues/1000 workaround] for this issue<br />
<br><br><br />
'''* Making the mistake of using a 64-bit prefix may ''specifically'' result in:'''<br />
* "SD #16 Error" when connecting to a server<br />
* "libcef.dll" MTA crash upon joining servers, or during gameplay (when server uses CEF and your CEF web browser is enabled)<br />
* Even higher chance for instability, lag issues and game crashes<br />
.. and much more<br />
<br />
<br><br />
<br />
===Specific issues with workarounds===<br />
<br><br />
'''Crash when connecting'''<br><br />
Sometimes the audio-server makes problems (could be related to PulseAudio), in this case, you've to go to WineConfig and choose the tab Audio, then deselect "ALSA" and select "EsoundD". Save the settings and restart MTA.<br><br><br />
'''Crash in basswma.dll module while streaming audio'''<br><br />
Workaround: Install Windows Media Player 11<br><br />
Before carrying this out, [https://wiki.winehq.org/Winetricks install Winetricks]<br />
<syntaxhighlight lang="lua"><br />
winetricks -q wmp11<br />
<br />
If that doesnt solve the issue, try an older version:<br />
winetricks -q wmp10<br />
</syntaxhighlight><br />
<br />
'''Special Detections (SD)'''<br><br />
This was already described above in general terms, of possible issues if you're not using 32-bit prefix as is recommended. But for this "Specific issues" section we will go in-depth more regarding '''SD #21''' kick from AC that commonly affects Linux/Wine users:<br><br />
If you are using a 64-bit wine version/prefix you may have problems with [http://wiki.multitheftauto.com/wiki/Anti-cheat_guide#.3Cenablesd.3E.3C.2Fenablesd.3E Special Detections]. If the server you are trying to connect keeps showing something like [http://i.imgur.com/33T8a82.jpg this], then you should make a [https://wiki.archlinux.org/title/Wine#WINEARCH 32 bit wine prefix] (or bottle).<br />
<br />
<syntaxhighlight lang="lua">export WINEARCH=win32 WINEPREFIX=~/.winegta<br />
winecfg</syntaxhighlight><br />
Look at your Windows version and press OK to create the prefix. Now you have a 32-bit wine prefix on ~/.winegta.<br />
Install GTA:SA and them MTA.<br />
After this, MTA and GTA have been installed within ~/.winegta prefix which is a 32-bit wine environment.<br />
<br />
'''Note''': In some scenario's, while creating your 32-bit prefix, it may be needed to change Windows version on the bottom to Windows 7. But avoid it whenever possible.<br />
<br><br><br />
'''Closing words'''<br><br />
To avoid many of the roadblocks when it comes to Linux/Wine issues in general, just use 32-bit Prefix as suggested. However, if you still run into issues, you can inform yourself better about MTA's Linux/Mac support levels and background by joining the [https://discord.gg/mtasa MTA discord] and going to #help-support channel, to specifically read information at this pinned message: https://discord.com/channels/278474088903606273/278521065435824128/894932698269900830<br />
<br><br />
<br />
We realize that the wiki pages & documentation regarding Linux, macOS support (such as: through Wine, Lutris, PlayOnLinux, Parallels Desktop etc) is far from perfect, and that the list of potential issues you can run into isn't complete. As the MTA discord linked post tries to explain, these platforms are supported on a best-effort basis (in a technical sense, not an user support sense) and even then you'll find others on the MTA discord that are Linux users & play MTA after performing some workarounds, that may be willing to help you. These people are also advised to add any known issue (and workaround for it) to the wiki documentations, so if that sounds like you then feel free to edit this page for instance, and help future users that find themselves in the same situation as you were. Linux/Wine just gives really obscure, hard to fix issues with MTA and other applications/games, including niche ones that individual users happen to resolve somehow.. that's the point.<br />
<br />
== See Also ==<br />
* [http://nightly.mtasa.com/ nightly.mtasa.com] - For nightly builds.<br />
* https://bugs.mtasa.com/view.php?id=8895 - a bug report containing useful info for running MTA in Wine<br />
[[Category:Support]]<br />
[[ru:Client on Linux Manual]]<br />
[[hu:Client on Linux Manual]]</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=EngineRequestModel&diff=67779EngineRequestModel2020-11-23T15:40:40Z<p>TheNormalnij: </p>
<hr />
<div>__NOTOC__<br />
{{Client function}}<br />
{{New feature/item|3.0158|1.5.7|20147|This function is used to assign the next available model ID to a certain element type. After release 1.5.8-20716 this function supports "vehicle" and "object" too.}}<br />
{{note|IMPORTANT:<br />
*before release 1.5.8-20716 this must be "ped".<br />
}}<br />
==Syntax==<br />
<syntaxhighlight lang="lua"><br />
int engineRequestModel ( str elementType [, int parentID] )<br />
</syntaxhighlight><br />
===Required Arguments===<br />
*'''elementType''': "ped", "vehicle" and "object".<br />
<br />
===Optional Arguments=== <br />
*'''parentID''': The [[Vehicle IDs|vehicle ID]] of the vehicle being allocated. '''(By default this is: 1337 - objects, 400 - vehicles, 7 or PSYCHO for peds)'''<br />
<br />
===Returns===<br />
{{New feature/item|3.0158|1.5.7|20147| Returns an ''integer'' of the model ID that was available to be assigned to the element type, ''false'' if no free model ID available or invalid element type.}}<br />
Do not rely on the model numbers returned being consistent across multiple clients or multiple runs of resources. There is no guarantee for the order of the numbers or that the same numbers will always correspond to the same element type. Any patterns are coincidental<br />
<br />
==Example==<br />
This example creates a ped and then gives you the opportunity to change its model. If the resource stops, then the IDs allocated will be deallocated. Use ''/cap'' for creating the ped and ''/sap'' to skin the ped. You will need some skins added to a folder and to the meta.xml for ''/sap'' to work.<br />
<syntaxhighlight lang="lua"><br />
local peds = {}<br />
function createAllocatedPed()<br />
local x, y, z = getElementPosition(localPlayer)<br />
local id = engineRequestModel("ped")<br />
peds[id] = createPed(id, x+0.5, y, z+0.5)<br />
outputChatBox("New ped with ID "..id.." created.")<br />
end<br />
addCommandHandler("cap", createAllocatedPed, false, false)<br />
<br />
function skinAllocatedPeds()<br />
local txd, dff;<br />
for id,ped in pairs(peds) do<br />
if fileExists("skins/" .. id .. ".txd") and fileExists("skins/" .. id .. ".dff") then<br />
txd = engineLoadTXD("skins/" .. id .. ".txd")<br />
engineImportTXD(txd, id)<br />
dff = engineLoadDFF("skins/" .. id .. ".dff")<br />
engineReplaceModel(dff, id)<br />
outputChatBox("Model ID "..id.." changed correctly.")<br />
else<br />
outputChatBox("Model ID "..id.." couldn't change. REASON: skins/" .. id .. ".txd or skins/" .. id .. ".dff does not exist.")<br />
end<br />
end<br />
end<br />
addCommandHandler("sap", skinAllocatedPeds, false, false)<br />
<br />
function onStop()<br />
for id,ped in pairs(peds) do<br />
engineFreeModel(id)<br />
end<br />
end<br />
addEventHandler("onClientResourceStop", resourceRoot, onStop)<br />
</syntaxhighlight><br />
<br />
==Requirements==<br />
{{Requirements|n/a|1.5.7-9.20147|}}<br />
<br />
==See Also==<br />
{{Engine functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=User_talk:TheNormalnij&diff=67053User talk:TheNormalnij2020-07-15T12:41:00Z<p>TheNormalnij: Blanked the page</p>
<hr />
<div></div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=OnClientFileDownloadComplete&diff=65990OnClientFileDownloadComplete2020-04-24T18:46:55Z<p>TheNormalnij: /* Parameters */</p>
<hr />
<div>{{Client event}}<br />
{{New items|3.0140|1.4|<br />
__NOTOC__ <br />
This event is triggered when a file has been downloaded after [[downloadFile]] has been successfully called.<br />
}}<br />
==Parameters== <br />
<syntaxhighlight lang="lua"><br />
string fileName, bool success, resource requestResource<br />
</syntaxhighlight> <br />
<br />
*'''fileName''': the file downloaded.<br />
*'''success''': whether successful or not.<br />
{{New items|4.0157|1.5.7-20468|<br />
*'''requestResource''': the resource that called [[downloadFile]].<br />
}}<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[root element]] of the resource that downloaded file.<br />
<br />
==Example== <br />
This example plays a sound if it was downloaded successfully<br />
<syntaxhighlight lang="lua"><br />
function onDownloadFinish ( file, success )<br />
if ( source == resourceRoot ) then -- if the file relates to this resource<br />
if ( success ) then -- if the file was downloaded successfully<br />
if ( file == "test.mp3" ) then -- if the file name is what we were expecting<br />
currentTrack = playSound ( "test.mp3" )<br />
end<br />
else -- if the file wasn't downloaded successfully<br />
if ( file == "test.mp3" ) then<br />
outputChatBox ( "test.mp3 failed to download" )<br />
end<br />
end<br />
end<br />
end<br />
addEventHandler ( "onClientFileDownloadComplete", root, onDownloadFinish )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
===Other client events===<br />
{{Client_other_events}}<br />
===Client event functions===<br />
{{Client_event_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=OnClientFileDownloadComplete&diff=65989OnClientFileDownloadComplete2020-04-24T18:11:12Z<p>TheNormalnij: </p>
<hr />
<div>{{Client event}}<br />
{{New items|3.0140|1.4|<br />
__NOTOC__ <br />
This event is triggered when a file has been downloaded after [[downloadFile]] has been successfully called.<br />
}}<br />
==Parameters== <br />
<syntaxhighlight lang="lua"><br />
string fileName, bool success, resource requestResource<br />
</syntaxhighlight> <br />
<br />
*'''fileName''': the file downloaded.<br />
*'''success''': whether successful or not.<br />
{{New items|4.0153|1.5.7-20468|<br />
*'''requestResource''': the resource that called [[downloadFile]].<br />
}}<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[root element]] of the resource that downloaded file.<br />
<br />
==Example== <br />
This example plays a sound if it was downloaded successfully<br />
<syntaxhighlight lang="lua"><br />
function onDownloadFinish ( file, success )<br />
if ( source == resourceRoot ) then -- if the file relates to this resource<br />
if ( success ) then -- if the file was downloaded successfully<br />
if ( file == "test.mp3" ) then -- if the file name is what we were expecting<br />
currentTrack = playSound ( "test.mp3" )<br />
end<br />
else -- if the file wasn't downloaded successfully<br />
if ( file == "test.mp3" ) then<br />
outputChatBox ( "test.mp3 failed to download" )<br />
end<br />
end<br />
end<br />
end<br />
addEventHandler ( "onClientFileDownloadComplete", root, onDownloadFinish )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
===Other client events===<br />
{{Client_other_events}}<br />
===Client event functions===<br />
{{Client_event_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=User_talk:TheNormalnij&diff=65988User talk:TheNormalnij2020-04-24T15:44:49Z<p>TheNormalnij: /* Parameters */</p>
<hr />
<div>{{Client event}}<br />
{{New items|3.0140|1.4|<br />
__NOTOC__ <br />
This event is triggered when a file has been downloaded after [[downloadFile]] has been successfully called.<br />
}}<br />
==Parameters== <br />
<syntaxhighlight lang="lua"><br />
string fileName, bool success, resource requestResource<br />
</syntaxhighlight> <br />
<br />
*'''fileName''': the file downloaded.<br />
*'''success''': whether successful or not.<br />
{{New items|4.0153|1.5.7-20468|<br />
*'''requestResource''': the resource that called [[downloadFile]].<br />
}}<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[root element]] of the resource that downloaded file.<br />
<br />
==Example== <br />
This example plays a sound if it was downloaded successfully<br />
<syntaxhighlight lang="lua"><br />
function onDownloadFinish ( file, success )<br />
if ( source == resourceRoot ) then -- if the file relates to this resource<br />
if ( success ) then -- if the file was downloaded successfully<br />
if ( file == "test.mp3" ) then -- if the file name is what we were expecting<br />
currentTrack = playSound ( "test.mp3" )<br />
end<br />
else -- if the file wasn't downloaded successfully<br />
if ( file == "test.mp3" ) then<br />
outputChatBox ( "test.mp3 failed to download" )<br />
end<br />
end<br />
end<br />
end<br />
addEventHandler ( "onClientFileDownloadComplete", root, onDownloadFinish )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
===Other client events===<br />
{{Client_other_events}}<br />
===Client event functions===<br />
{{Client_event_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=User_talk:TheNormalnij&diff=65717User talk:TheNormalnij2020-04-07T21:27:06Z<p>TheNormalnij: Created page with "{{Client event}} {{New items|3.0140|1.4| __NOTOC__ This event is triggered when a file has been downloaded after downloadFile has been successfully called. }} ==Parameter..."</p>
<hr />
<div>{{Client event}}<br />
{{New items|3.0140|1.4|<br />
__NOTOC__ <br />
This event is triggered when a file has been downloaded after [[downloadFile]] has been successfully called.<br />
}}<br />
==Parameters== <br />
<syntaxhighlight lang="lua"><br />
string fileName, bool success, resource requestResource<br />
</syntaxhighlight> <br />
<br />
*'''fileName''': the file downloaded.<br />
*'''success''': whether successful or not.<br />
*'''requestResource''': the resource that called [[downloadFile]].<br />
<br />
==Source==<br />
The [[event system#Event source|source]] of this event is the [[root element]] of the resource that downloaded file.<br />
<br />
==Example== <br />
This example plays a sound if it was downloaded successfully<br />
<syntaxhighlight lang="lua"><br />
function onDownloadFinish ( file, success )<br />
if ( source == resourceRoot ) then -- if the file relates to this resource<br />
if ( success ) then -- if the file was downloaded successfully<br />
if ( file == "test.mp3" ) then -- if the file name is what we were expecting<br />
currentTrack = playSound ( "test.mp3" )<br />
end<br />
else -- if the file wasn't downloaded successfully<br />
if ( file == "test.mp3" ) then<br />
outputChatBox ( "test.mp3 failed to download" )<br />
end<br />
end<br />
end<br />
end<br />
addEventHandler ( "onClientFileDownloadComplete", root, onDownloadFinish )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
===Other client events===<br />
{{Client_other_events}}<br />
===Client event functions===<br />
{{Client_event_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=Template:Client_other_events&diff=46860Template:Client other events2016-03-13T11:04:29Z<p>TheNormalnij: </p>
<hr />
<div>*[[onClientConsole]]<br />
*[[onClientDebugMessage]]<br />
*[[onClientHUDRender]]<br />
*[[onClientMinimize]]<br />
*[[onClientRestore]]<br />
*[[onClientRender]]<br />
*[[onClientExplosion]]<br />
*[[onClientChatMessage]]<br />
*[[onClientPreRender]]<br />
*[[onClientFileDownloadComplete]]<br />
{{New items|3.0142|1.4.1-7295|<br />
*[[onClientPlayerNetworkStatus]]<br />
}}<br />
<noinclude>[[Category:Events templates]]</noinclude></div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=Talk:GenerateRandomHEXColor&diff=41234Talk:GenerateRandomHEXColor2014-08-08T20:37:28Z<p>TheNormalnij: Created page with "<syntaxhighlight lang="lua">function generateRandomHEXColor( ) return '#' .. string.format( '%.6X', math.random( 0x000000, 0xFFFFFF ) ) end </syntaxhighlight> LOL --~~~~"</p>
<hr />
<div><syntaxhighlight lang="lua">function generateRandomHEXColor( )<br />
return '#' .. string.format( '%.6X', math.random( 0x000000, 0xFFFFFF ) )<br />
end </syntaxhighlight><br />
LOL --[[User:TheNormalnij|TheNormalnij]] ([[User talk:TheNormalnij|talk]]) 20:37, 8 August 2014 (UTC)</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=SetPlayerNametagShowing&diff=39624SetPlayerNametagShowing2014-05-27T20:23:15Z<p>TheNormalnij: /* Example */</p>
<hr />
<div>__NOTOC__<br />
{{Server client function}}<br />
{{New feature|3|1.0|This function allows you to set whether a player's nametag visibility both clientside and serverside}}<br />
<br />
Use this to define whether the player's name tag is visible or invisible.<br />
<br />
==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
<syntaxhighlight lang="lua"><br />
bool setPlayerNametagShowing ( player thePlayer, bool showing )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
*'''thePlayer:''' Define the player whos tag visiblity status you want to change<br />
*'''showing:''' Use true or false to show/hide the tag<br />
<br />
===Returns===<br />
Returns ''true'' if successful, ''false'' otherwise<br />
<br />
==Example== <br />
This script will turn off player tags for everyone<br />
<syntaxhighlight lang="lua"><br />
function onResourceStart ( )<br />
local players = getElementsByType ( "player" ) -- Store all the players in the server into a table<br />
for key, player in ipairs ( players ) do -- for all the players in the table<br />
setPlayerNametagShowing ( player, false ) -- turn off their nametag<br />
end<br />
end<br />
addEventHandler ( "onResourceStart", root, onResourceStart )<br />
<br />
function onPlayerJoin ( )<br />
-- Whoever joins the server should also have their nametags deactivated<br />
setPlayerNametagShowing ( source, false )<br />
end<br />
addEventHandler ( "onPlayerJoin", root, onPlayerJoin )<br />
<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
{{Player functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=SetPlayerNametagText&diff=39623SetPlayerNametagText2014-05-27T20:19:06Z<p>TheNormalnij: /* Example */ fix</p>
<hr />
<div>__NOTOC__ <br />
{{Server client function}}<br />
<!-- Describe in plain english what this function does. Don't go into details, just give an overview --><br />
This will change the text of a player's nickname in the world to something besides the nickname he chose. This will not change the player's actual nickname, it only changes the visible aspect inside the world (you will see his original nickname in the scoreboard and will refer to his original name in scripts).<br />
<br />
==Syntax== <br />
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --><br />
<syntaxhighlight lang="lua"><br />
bool setPlayerNametagText ( player thePlayer, string text )<br />
</syntaxhighlight> <br />
<br />
===Required Arguments=== <br />
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --><br />
*'''thePlayer:''' The player whose nickname text you wish to change<br />
*'''text:''' The new nickname text that will be displayed<br />
<br />
===Returns===<br />
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --><br />
Returns ''true'' if successful, ''false'' otherwise.<br />
<br />
==Example== <br />
This console command lets you change the name tag of lamers.<br />
<syntaxhighlight lang="lua"><br />
function iHateLamers ( thePlayer, commandName, playername )<br />
-- This is a command handler that activates on text "lamer" followed by the playername<br />
-- in the console. The playername argument was added as an extra function argument to store the<br />
-- name of the player whose text will be changed.<br />
if not playername then<br />
-- Prevents the command from running if the player did not specify a value for playername<br />
outputChatBox ( "You MUST define a player to change his name tag!", thePlayer )<br />
else<br />
local culprit = getPlayerFromName ( playername )<br />
-- This variable stores the result of trying to find the player associated with the playername<br />
-- that the user of the command specified<br />
if culprit then<br />
-- This checks to make sure a player nick was found. If it was not then the playername argument<br />
-- specified by the command user was not equivalent to the name of any players in the server<br />
setPlayerNametagText ( culprit, "IM_LAME" )<br />
-- finally, the nickname text is changed since the command arguments were checked and are valid<br />
else<br />
outputChatBox ( "Player does not exist!", thePlayer )<br />
end<br />
end<br />
end<br />
addCommandHandler ( "lamer", iHateLamers )<br />
</syntaxhighlight><br />
<br />
==See Also==<br />
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --><br />
{{Player_functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=Talk:IsVehicleOccupied&diff=39585Talk:IsVehicleOccupied2014-05-23T20:53:19Z<p>TheNormalnij: Created page with "Bad function name. User bad programmer.--~~~~"</p>
<hr />
<div>Bad function name. User bad programmer.--[[User:TheNormalnij|TheNormalnij]] ([[User talk:TheNormalnij|talk]]) 20:53, 23 May 2014 (UTC)</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=IsVehicleOccupied&diff=39584IsVehicleOccupied2014-05-23T20:43:20Z<p>TheNormalnij: /* Code */</p>
<hr />
<div>{{Useful Function}}<br />
<lowercasetitle></lowercasetitle><br />
__NOTOC__<br />
This function check if any players in the vehicle.<br />
<br />
==Syntax==<br />
<syntaxhighlight lang="lua">bool isPlayersInVehicle( element vehicle)</syntaxhighlight><br />
<br />
===Required Arguments===<br />
* '''vehicle''': The vehicle you want check if players in it.<br />
<br />
===Returns===<br />
Return true if there any players in vehicle, false otherwise.<br />
<br />
==Code==<br />
<section name="Serverside Script" class="server" show="true"><br />
<syntaxhighlight lang="lua"><br />
function isPlayersInVehicle(Vehicle)<br />
if isElement(Vehicle) and getElementType(Vehicle) == "vehicle" then<br />
local occupants = getVehicleOccupants(Vehicle)<br />
if occupants then<br />
for seat, occupant in pairs(occupants) do<br />
if occupant then<br />
return true<br />
end<br />
end<br />
end<br />
end<br />
return false<br />
end<br />
</syntaxhighlight><br />
</section><br />
<br />
==Example==<br />
<section name="Server" class="server" show="true"><br />
This example checks if there any players in Vehicle.<br />
<syntaxhighlight lang="lua"><br />
<br />
</syntaxhighlight><br />
</section><br />
<br />
==See Also==<br />
{{Useful_Functions}}</div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=Template:Client_weapon_functions&diff=36845Template:Client weapon functions2013-08-07T07:14:06Z<p>TheNormalnij: </p>
<hr />
<div>*[[getWeaponIDFromName]]<br />
*[[getWeaponNameFromID]]<br />
{{New items|3.0120|1.2|<br />
*[[getSlotFromWeapon]]<br />
*[[getWeaponProperty]]<br />
*[[getOriginalWeaponProperty]]<br />
}}<br />
<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>TheNormalnijhttps://wiki.multitheftauto.com/index.php?title=Template:Client_weapon_functions&diff=36822Template:Client weapon functions2013-08-03T13:26:20Z<p>TheNormalnij: </p>
<hr />
<div>*[[getWeaponIDFromName]]<br />
*[[getWeaponNameFromID]]<br />
{{New items|3.0120|1.2|<br />
*[[getSlotFromWeapon]]<br />
*[[getWeaponProperty]]<br />
*[[setWeaponProperty]]<br />
*[[getOriginalWeaponProperty]]<br />
}}<br />
<br />
<noinclude>[[Category:Functions templates]]</noinclude></div>TheNormalnij