--// VALEU DUTCHMAN POR FAZER UM BELO TRABALHO NO MANUSEIO DE MEMÓRIA DO MTA //-- --// THANKS DUTCHMAN FOR DOING A GREAT JOB IN MTA MEMORY MANAGER (LEAK) //-- addEventHandler('onClientResourceStart', resourceRoot, function() engineSetAsynchronousLoading(true, true) engineStreamingSetModelCacheLimits(10, 10) -- engineStreamingSetMemorySize(265 * 1024 * 1024) end) setTimer(function() local MEMORY_SIZE = engineStreamingGetMemorySize() local USED_MEMORY = engineStreamingGetUsedMemory() if USED_MEMORY >= (MEMORY_SIZE * 0.75) then engineStreamingFreeUpMemory(75 * 1024 * 1024) iprint('[nc_core]: Memory has been cleaned up', 'BEFORE: '..math.round(USED_MEMORY), 'AFTER: '..math.round(engineStreamingGetUsedMemory()), 'LIMIT:'..math.round(MEMORY_SIZE)) end end, 5 * 60000, 0)