natives.requestStreamedTxd

From GTA Connected
Jump to navigation Jump to search

Function Client Only icon-iv.png Online and Offline

Available since Client 1.0.0

void natives.requestStreamedTxd(string txdName, bool persistent)

The natives.requestStreamedTxd function is used to Requests a streamed TXD to be loaded into memory so its textures can be accessed.

Parameters

1) string txdName Name of the streamed TXD (texture dictionary) to request.
2) bool persistent If true, keeps the TXD loaded persistently; if false, it may be unloaded when not needed.

Return

void This function doesn't return a value.

Notes

  • - Unlike natives.loadTxd, this function can request TXDs that are **outside the default texture folder**, since it uses the streaming system of the game- Must be called before using natives.getTextureFromStreamedTxd to retrieve textures from that TXD.

Examples

Example 1 - JavaScript:

bindEventHandler("OnResourceReady", thisResource, function() {

   // Request a streamed TXD for a weapon icon
   natives.requestStreamedTxd("w_glock", true);

});

Compatibility

There isn't any compatibility information for this function.