EngineStreamingRestoreMemorySize

From Multi Theft Auto: Wiki
Revision as of 23:19, 25 August 2023 by Pirulax (talk | contribs) (Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0160|1.6.0|21874|Restores the maximum amount of RAM [in bytes] that can be used for streaming to the default value}} {{Tip|The function to manipulate the memory size is engineStreamingSetMemorySize}} ==Syntax== <syntaxhighlight lang="lua"> nil engineStreamingSetMemorySize() </syntaxhighlight> {{OOP||EngineStreaming:restoreMemorySize||}} ==Example== This example adds a command that can be used to change the stre...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Restores the maximum amount of RAM [in bytes] that can be used for streaming to the default value

[[{{{image}}}|link=|]] Tip: The function to manipulate the memory size is engineStreamingSetMemorySize

Syntax

nil engineStreamingSetMemorySize()

OOP Syntax Help! I don't understand this!

Method: EngineStreaming:restoreMemorySize(...)


Example

This example adds a command that can be used to change the streaming memory size, and display the previous value.

addCommandHandler("rsms", function()
    local prevMB = math.floor(engineGetStreamingMemorySize() / 1024 / 1024)
    engineStreamingRestoreMemorySize()
    outputChatbox("The maximum streaming memory available has been restored to the original value of " .. math.floor(engineGetStreamingMemorySize() / 1024 / 1024) .. " MB [Was " .. prevMB .. " MB]")
end, false, false)

Requirements

Minimum server version n/a
Minimum client version 1.6.0-9.21874

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.6.0-9.21874" />

See Also