SourceMod 1.10 and new OnEntitySpawned forward

This commit is contained in:
BotoX
2019-09-10 16:34:12 +02:00
parent 4bb399c18d
commit ad2f7cd71a
26 changed files with 802 additions and 975 deletions
+4 -14
View File
@@ -1,10 +1,6 @@
#pragma semicolon 1
#pragma newdecls required
#include <basic>
#include "CConfig.inc"
#include "CBoss.inc"
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
@@ -359,7 +355,9 @@ public void OnMapStart()
int entity = INVALID_ENT_REFERENCE;
while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE)
{
OnEntitySpawned(entity);
char sClassname[64];
if(GetEntityClassname(entity, sClassname, sizeof(sClassname)))
OnEntitySpawned(entity, sClassname);
}
}
}
@@ -387,15 +385,7 @@ public void Event_RoundEnd(Event event, const char[] name, bool dontBroadcast)
g_aHadOnce = new StringMap();
}
public void OnEntityCreated(int entity, const char[] classname)
{
if(!g_aConfig)
return;
SDKHook(entity, SDKHook_SpawnPost, OnEntitySpawned);
}
public void OnEntitySpawned(int entity)
public void OnEntitySpawned(int entity, const char[] classname)
{
if(!g_aConfig)
return;