mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 21:33:20 +00:00
population_control: Fix the common limit crashing server
(I mean it did limit the commons...)
This commit is contained in:
parent
2e7715e72f
commit
761a21c22e
2 changed files with 6 additions and 2 deletions
Binary file not shown.
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
#include <sdktools>
|
#include <sdktools>
|
||||||
//#include <sdkhooks>
|
#include <sdkhooks>
|
||||||
|
|
||||||
public Plugin myinfo =
|
public Plugin myinfo =
|
||||||
{
|
{
|
||||||
|
@ -113,7 +113,7 @@ public void OnEntityCreated(int entity, const char[] classname) {
|
||||||
//If limiter turned on:
|
//If limiter turned on:
|
||||||
if(commonLimit != 0) {
|
if(commonLimit != 0) {
|
||||||
if(iCurrentCommons > commonLimit) {
|
if(iCurrentCommons > commonLimit) {
|
||||||
AcceptEntityInput(entity, "kill");
|
SDKHook(entity, SDKHook_SpawnPost, Hook_SpawnPost);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,6 +140,10 @@ public void OnEntityCreated(int entity, const char[] classname) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Action Hook_SpawnPost(int entity) {
|
||||||
|
AcceptEntityInput(entity, "Kill");
|
||||||
|
}
|
||||||
|
|
||||||
public Action Event_InfectedDeath(Event event, const char[] name, bool dontBroadcast) {
|
public Action Event_InfectedDeath(Event event, const char[] name, bool dontBroadcast) {
|
||||||
--iCurrentCommons;
|
--iCurrentCommons;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue