MTA:Eir/functions/engineIsWorldStreamingEnabled

From Multi Theft Auto: Wiki
Revision as of 19:55, 10 December 2013 by The GTA (talk | contribs) (Created page with "__NOTOC__ This function returns whether the native GTA:SA world is allowed to stream and render. This property is meant to be used along with maps that are meant to exist stand-...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function returns whether the native GTA:SA world is allowed to stream and render. This property is meant to be used along with maps that are meant to exist stand-alone (such as total conversion maps).

Syntax

bool engineIsWorldStreamingEnabled ()

Returns

Returns true if native world streaming is enabled, false otherwise.

Example

Click to collapse [-]
Client

This snippet plays a sound depending on whether world streaming is enabled or not. It expects two sound files: "win.wav" and "fail.wav"

addCommandHandler( "world_check",
    function()
        local isEnabled = engineIsWorldStreamingEnabled();

        if ( isEnabled ) then
            playSound( "win.wav" );
        else
            playSound( "fail.wav" );
        end
    end
);