View Single Post
Solar1234
Junior Member
Join Date: Nov 2021
Old 04-29-2024 , 09:03   Re: [L4D2] Why did it trigger twice? What happened in between
Reply With Quote #3

Quote:
Originally Posted by Marttt View Post
this snippet is wrong (what is this bot variable) so is hard to help
try sharing the full .sp file
Copy error, the following is the correct content:

PHP Code:
public void OnEntityCreated(int entity, const char[] classname)
{
    if(
classname[0] != 's' || strcmp(classname"survivor_bot"false) != 0)
        return;

    
SDKHook(entitySDKHook_SpawnPostSpawnPost_Bot);
}

void SpawnPost_Bot(int entity)
{
    if(!
IsValidEntity(entity))
        return;

    if(
GetClientTeam(entity) == 4)
    {
        
RemoveEntity(entity);
        return;
    }
    
    
PrintToChatAll("\nDEBUG(%f): SpawnPost_Bot entity(%d) entityowner(%d)"GetEngineTime(), entityGetEntPropEnt(entityProp_Data"m_hOwnerEntity"));
}

DEBUG(1214.675781): SpawnPost_Bot entity(2entityowner(-1)
DEBUG(1214.675903): SpawnPost_Bot entity(2entityowner(-1)
DEBUG(1214.675903): SpawnPost_Bot entity(3entityowner(-1)
DEBUG(1214.675903): SpawnPost_Bot entity(3entityowner(-1)
DEBUG(1214.675903): SpawnPost_Bot entity(3entityowner(-1)
DEBUG(1214.676025): SpawnPost_Bot entity(4entityowner(-1)
DEBUG(1214.676025): SpawnPost_Bot entity(4entityowner(-1
Solar1234 is offline