SetOcclusionsEnabled

From Multi Theft Auto: Wiki
Revision as of 10:45, 13 May 2012 by X86dev (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function is used to enable or disable occlusions. Occlusions are used by GTA to enhance performance by hiding objects that are (normally) obscured by certain large buildings. However when removeWorldModel is used they may also have the undesired effect of making parts of the map disappear. Disabling occlusions will fix that.

Syntax

bool setOcclusionsEnabled ( bool enabled )

Required Arguments

  • enabled: A bool specifying if GTA occlusions should be enabled

Returns

Returns true if the setting was set correctly, false if invalid arguments were passed.

Example

This example shows occlusions being disabled after the whole map has been cleared:

-- Remove all world models
for i=550,20000 do
    removeWorldModel(i,10000,0,0,0)
end
-- Turn off occlusions
setOcclusionsEnabled( false )

Requirements

Minimum server version 1.3
Minimum client version 1.3

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 server="1.3" client="1.3" />

See Also