View Single Post
FuZ!on
Senior Member
Join Date: Aug 2007
Old 03-22-2020 , 11:14   Re: [CSGO] Entity name not pulling back
Reply With Quote #11

Quote:
Originally Posted by DJ Tsunami View Post
Entity properties are not yet available in OnEntityCreated, you need to wait until the entity is spawned.
This is the correct answer. I was able to pull back the name on round_start.

PHP Code:
public void OnPluginStart()
{
    
HookEventEx("round_start"start_roundEventHookMode_PostNoCopy);
}

public 
start_round(Event event, const char[] namebool dontBroadcast)
{
    
char ent_name[60]; 
    
int ent = -1;
    
    while((
ent FindEntityByClassname(ent"trigger_multiple")) != -1)
    {
        
GetEntPropString(entProp_Data"m_iName"ent_namesizeof(ent_name));

        if(
StrEqual(ent_name"multiple1"false))
        {
            
LogMessage("Entity %d found.  Name: %s."entbuffer);
            break;
        }        
    }    

I did take the code from https://forums.alliedmods.net/showthread.php?p=1639789 and formed it my needs.
FuZ!on is offline