mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-05 23:23:21 +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
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <sourcemod>
|
||||
#include <sdktools>
|
||||
//#include <sdkhooks>
|
||||
#include <sdkhooks>
|
||||
|
||||
public Plugin myinfo =
|
||||
{
|
||||
|
@ -113,7 +113,7 @@ public void OnEntityCreated(int entity, const char[] classname) {
|
|||
//If limiter turned on:
|
||||
if(commonLimit != 0) {
|
||||
if(iCurrentCommons > commonLimit) {
|
||||
AcceptEntityInput(entity, "kill");
|
||||
SDKHook(entity, SDKHook_SpawnPost, Hook_SpawnPost);
|
||||
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) {
|
||||
--iCurrentCommons;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue