Garry's Mod

Garry's Mod

465 ratings
Model PreCRASH Prevention
9
5
3
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build
File Size
Posted
2.770 KB
21 Jul, 2020 @ 11:22am
1 Change Note ( view )

Subscribe to download
Model PreCRASH Prevention

In 1 collection by Fay
[SERVER] Power Plant RP Remastered
87 items
Description
4096 is the current Garry's Mod Model Precache Limit

A model is precached when it is spawned for the first time. When this limit is hit, the server will immediately crash without warning. This precache cannot be cleared using lua alone, so this addon aims to prevent players from hitting this limit and causing a crash, whether it was intentional or not.

The way it works is simple:
1. Scan all initial models when map is loaded
2. Scan models as they are spawned (props, vehicles, etc.)
3. If a player tries to spawn a prop, ragdoll, or vehicle, and the limit is hit, prevent it. Players will receive a notice saying "MPCache Overflow!"

Convars (all serverside)
- mpcache_enabled (default: 1) - (1 or 0) Whether the model precache should be monitored and protected
- mpcache_headroom (default: 512) - (0 to 4096) How far below the limit should the precache be protected from new models

NOTE: It is not recommended to ride up extremely close to the model precache limit, as lua addons cannot be prevented from spawning their own models. For that reason, I suggest not changing mpcache_headroom to anything below 512.
76 Comments
ryanbailes06 17 Jul @ 11:49am 
why do we need to hear that this is not about the addon
Miss Maya 28 Jan @ 9:32am 
WARNING! Carry on reading! Or you will die, even if you only looked at the word warning! Once there was a little girl called Clarissa, she was ten-years-old and she lived in a mental hospital, because she killed her mom and her dad. She got so bad she went to kill all the staff in the hospital so the More- government decided that best idea was to get rid of her so they set up a special room to kill her, as humane as possible but it went wrong the machine they were using went wrong. And she sat there in agony for hours until she died. Now every week on the day of her death she returns to the person that reads this letter, on a monday night at 12:00a.m. She creeps into your room and kills you slowly, by cutting you and watching you bleed to death. Now send this to ten other profiles on this one site, and she will haunt someone else who doesn't. This isn't fake. apparently, if u copy and paste this to ten comments in the next ten minutes u will have the best of your life. TIC TOC.
✿ MilliPie. ✿ 19 Jan @ 8:39am 
Would be awesome if lag never existed.
pink.noise.chick 24 Jul, 2024 @ 1:21pm 
can you make engine error prevention that way i dont get tired of them coming out of nowhere
Mix Heart 29 May, 2023 @ 9:31pm 
Gmod Precache limit is stupidly low. All my TF2 content overflows gmod.
ᛉ RVNIK DETH ᛉ 25 Mar, 2023 @ 3:09pm 
oh and also how do i scan models
ᛉ RVNIK DETH ᛉ 24 Mar, 2023 @ 4:09pm 
does this addon help with my issue? i keep tying to start my game but it just says:
Host Error: CVEngineServer :PreacherModel:
'(insert random texture name)' overflow, too many models
Fay  [author] 3 Jun, 2022 @ 1:58pm 
VVV
AvoxPaine 2 Jun, 2022 @ 6:33pm 
For anyone that still wants to use this, just extract the addon and remove everything after line 63.
Fay  [author] 25 May, 2022 @ 10:36pm 
Damn I really left that test code in there, my bad. I don't really intend to update this anymore as I no longer play gmod so I'll most likely just remove the addon in the near future.