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 -13
View File
@@ -227,7 +227,9 @@ stock bool LoadConfig()
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);
}
}
@@ -268,18 +270,7 @@ public void OnRoundEnd(Event hEvent, const char[] sEvent, bool bDontBroadcast)
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void OnEntityCreated(int entity, const char[] sClassname)
{
if (Entity_IsValid(entity))
{
SDKHook(entity, SDKHook_SpawnPost, OnEntitySpawned);
}
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void OnEntitySpawned(int entity)
public void OnEntitySpawned(int entity, const char[] classname)
{
if (Entity_IsValid(entity) && g_hArray_Configs.Length)
{