EngineStreamingGetBufferSize

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

Get the streaming buffer size [not maximum memory size]

Syntax

int engineStreamingGetBufferSize()

OOP Syntax Help! I don't understand this!

Method: EngineStreaming:getBufferSize(...)
Variable: .bufferSize
Counterpart: engineStreamingSetBufferSize


Returns

The streaming buffer size. It is always a positive non-zero number.

Example

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

addCommandHandler("sbs", function(_, sizeMB)
    if tonumber(sizeMB) then
        if engineStreamingSetBufferSize(tonumber(sizeMB) * 1024 * 1024) then -- Convert MB to Bytes
            outputChatbox("The streaming buffer size has been changed from " .. math.floor(engineStreamingGetBufferSize() / 1024 / 1024) .. " MB to " .. sizeMB .. " MB")
        else
            outputChatbox("Not enough memory!")
        end
    else
        outputChatbox("Please enter a numeric value!")
    end
end, false, false)

See Also