EngineStreamingSetModelCacheLimits: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Filling in page data & structure)
mNo edit summary
 
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
 
This function sets custom cache limits for vehicle and pedestrian models based on provided values. The arguments that receive zero mean complete deactivation.
==Description==
This function sets custom cache limits for vehicle and pedestrian models based on provided values.<br>
The arguments that receive zero mean complete deactivation.


==Syntax==  
==Syntax==  
Line 16: Line 13:


===Returns===
===Returns===
Returns ''true'' if the event occurred, otherwise it throws an error message.
Returns ''true'' if the event occurred, otherwise it throws an error message and returns ''false''.


==Requirements==
==Requirements==

Latest revision as of 09:37, 30 June 2024

This function sets custom cache limits for vehicle and pedestrian models based on provided values. The arguments that receive zero mean complete deactivation.

Syntax

bool engineStreamingSetModelCacheLimits( [ int numVehicles, int numPeds ] )

Arguments

  • numVehicles: Specifies the maximum number of vehicle models that can be cached.
  • numPeds: Specifies the maximum number of pedestrian models that can be cached.

Returns

Returns true if the event occurred, otherwise it throws an error message and returns false.

Requirements

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

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.21947" />

Example

Click to collapse [-]
Client

This example turns off cache limiting.

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        engineStreamingSetModelCacheLimits(0, 0)
    end
)
Click to collapse [-]
Client

This example sets a limit of 128 for the cache.

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        engineStreamingSetModelCacheLimits(128, 128)
    end
)

See Also