AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D1 & L4D2] Zombie limits (https://forums.alliedmods.net/showthread.php?t=332237)

Dragokas 05-01-2021 11:29

[L4D1 & L4D2] Zombie limits
 
1 Attachment(s)
Purpose:
- Prevents server lags / low sv, when map/director decides to spawn too many zombies.
Description:
- Plugin instantly kills common zombies / special infected when their total number exceeds the limit specified by you.

Useful in cases with some (custom) maps where ConVars like "z_common_limit" e.t.c. doesn't help / or get overridden by some functions like this one / VScripts and so.

Plugin is not intended to limit the number of human-controlled infected in versus.

Conflicts:
This plugin does NOT affect any game ConVars, so it must be compatible with any other common/SI limits regulator plugins.

It counts the quantity manually and manually kills the leftovers over the limit.
Settings (ConVars):
Located at cfg/sourcemod/l4d_zombie_limits.cfg
PHP Code:

// Enable plugin (1 - On / 0 - Off)
l4d_zombie_limits_enabled "1"

// Maximum number of boomers allowed on the map simultaneously, 999 - to disable
l4d_zombie_limits_boomer "7"

// Maximum number of hunters allowed on the map simultaneously, 999 - to disable
l4d_zombie_limits_hunter "7"

// Maximum number of smokers allowed on the map simultaneously, 999 - to disable
l4d_zombie_limits_smoker "7"

// Maximum number of jockey allowed on the map simultaneously, 999 - to disable
l4d_zombie_limits_jockey "7"

// Maximum number of spitters allowed on the map simultaneously, 999 - to disable
l4d_zombie_limits_spitter "7"

// Maximum number of chargers allowed on the map simultaneously, 999 - to disable
l4d_zombie_limits_charger "7"

// Maximum number of tanks allowed on the map simultaneously, 999 - to disable
l4d_zombie_limits_tank "10"

// Maximum number of all special infected allowed on the map simultaneously (tank is not counting), 999 - to disable
l4d_zombie_limits_si "12"

// Maximum number of common zombies allowed on the map simultaneously, 999 - to disable
l4d_zombie_limits_common "40"

// Maximum number of witches allowed on the map simultaneously, 999 - to disable
l4d_zombie_limits_witch "10"

// Print debug messages? 1 - Yes, 0 - No
l4d_zombie_limits_print_debug "0" 

Commands:
PHP Code:

// Show the current number of each zombie type
sm_zcount 

Compatiblity:
- L4D1.
- L4D2.
Requirements:
- SourceMod v1.10+
Related plugins:
- [L4D1 & L4D2] Multi witches
- [DEV] Entity Limits Logger
Donate
Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
- Patreon (Paypal)
- BitCoin
- Ю.Money

Kid_Bandes 05-01-2021 12:04

Re: [L4D1 & L4D2] Zombie limits
 
Quote:

Plugin instantly kills common zombies / special infected
Is this mean spitter will die and leave her spit on the ground or just disappear, Dragokas?

jackz 05-01-2021 12:10

Re: [L4D1 & L4D2] Zombie limits
 
Quote:

Originally Posted by Kid_Bandes (Post 2745593)
Is this mean spitter will die and leave her spit on the ground or just disappear, Dragokas?

Looking at the code it runs RemoveEntity which I assume shouldn't drop any spit

Also this plugin is exactly what I need for those crappy custom maps, thanks

Dragokas 05-01-2021 12:31

Re: [L4D1 & L4D2] Zombie limits
 
Quote:

Originally Posted by Kid_Bandes (Post 2745593)
Is this mean spitter will die and leave her spit on the ground or just disappear, Dragokas?

Die within 0.1 sec for safe purposes (and, likely leave her spit). Does it matter? Anyway, it is spawned in safe place.
Otherwise, particles can infinitely cycle.

Dragokas 05-01-2021 12:46

Re: [L4D1 & L4D2] Zombie limits
 
Ok, I checked, it doesn't produce acid.

Marttt 05-01-2021 12:56

Re: [L4D1 & L4D2] Zombie limits
 
Great job @Dragokas,

Now I can play some custom maps that have entity/lag/fps problems caused by the number of commons being spawned.

As a note, I remember that maps that spawn zombies/SI through [(info_zombie_spawn / commentary_zombie_spawner) + logic_timer] entities usually leads to that.
(Rocket Escape and Helms Deep maps are such examples)

Kid_Bandes 05-01-2021 13:45

Re: [L4D1 & L4D2] Zombie limits
 
Thanks Dragokas, this is what I need for any custom maps that spawn more than 2 tanks at the same time while using with infected bots plugin :D

Edit: One question, is the cvar "l4d_zombie_limits_si" count tank?

Dragokas 05-02-2021 11:23

Re: [L4D1 & L4D2] Zombie limits
 
Updated.

Quote:

1.1 (02-May-2021)
- some optimizations.
- safe check for entity -1 in OnEntityDestroyed
- added ConVar "l4d_zombie_limits_witch" - Maximum number of witches allowed on the map simultaneously
For better witch number controlling experience it is recommended to use together with [L4D1 & L4D2] Multi witches, allowing to clear unused witched by distance.

Dragokas 05-02-2021 11:30

Re: [L4D1 & L4D2] Zombie limits
 
Updated.

Quote:

1.2 (02-May-2021)
- Removed tank from counting as special infected, thus not affected by SI Limits.

Mi.Cura 07-23-2021 18:32

Re: [L4D1 & L4D2] Zombie limits
 
Hi, Drakokas, Maybe you can help me

I have been getting this error:

L 07/23/2021 - 15:49:54: SourceMod error session started
L 07/23/2021 - 15:49:54: Info (map "c9m1_alleys") (file "f:\tcafiles\users\scotts1\41067\left4dead2\a ddons\sourcemod\logs\errors_20210723.log")
L 07/23/2021 - 15:49:54: [SM] Exception reported: Client 1 is not connected
L 07/23/2021 - 15:49:54: [SM] Blaming: l4d_zombie_limits.smx
L 07/23/2021 - 15:49:54: [SM] Call stack trace:
L 07/23/2021 - 15:49:54: [SM] [0] IsFakeClient
L 07/23/2021 - 15:49:54: [SM] [1] Line 278, /home/forums/content/files/2/8/2/6/6/7/189088.attach::OnClientDisconnect


All times are GMT -4. The time now is 20:05.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.