engineStreamingSetMemorySize | Multi Theft Auto: Wiki Skip to content

engineStreamingSetMemorySize

Client-side
Server-side
Shared

Pair: engineStreamingGetMemorySize

Added in 1.6.0 r21874

Sets the maximum amount of RAM [in bytes] that can be used for streaming.

Tip
  • The showmemstat command can be used to see this value in real-time [You might have to scroll down using PgDown on your keyboard].
  • To restore to default value use engineStreamingRestoreMemorySize.
Important

This function is meant for advanced users only, as it can lead to stability issues. Using a very high value might result in more crashes, while using a value too low might lead to frequent pop-in [and due to the way MTA works micro-stutter as well].

OOP Syntax Help! I don't understand this!

Syntax

nil engineStreamingSetMemorySize ( ​int sizeBytes )
Required Arguments
  • sizeBytes: The maximum amount of RAM [in bytes] that can be used for streaming. Must be a positive non-zero number.

Returns

  • nil: nothing

This functions returns nothing.

Code Examples

client

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

addCommandHandler("ssms", function(_, sizeMB)
if tonumber(sizeMB) then
outputChatBox("The maximum streaming memory available has been changed from " .. math.floor(engineStreamingGetMemorySize() / 1024 / 1024) .. " MB to " .. sizeMB .. " MB")
engineStreamingSetMemorySize(tonumber(sizeMB) * 1024 * 1024) -- Convert MB to Bytes
else
outputChatBox("Please enter a numeric value!")
end
end, false, false)

See Also

Engine Functions