Raised This Month: $ Target: $400
 0% 

He-Grenade Game 1.1


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-20-2013 , 08:33   Re: He-Grenade Game 1.1
Reply With Quote #18

Better to return -1 in Spawn forward then removing the entity.
Also, you don't need to remove all those entity, see in followinf example which ones are needed.
End, you could use a Trie for those classes.

PHP Code:
new Trie:g_tRemoveEntClasses;
new 
g_iFhDispatchSpawn;

public 
plugin_precache()
{
    new 
szRemoveEntClasses[][] = 
    {
        
"func_bomb_target""info_bomb_target"// de_
        
"func_hostage_rescue"// cs_
        
"func_escapezone"// es_
        
"func_vip_safetyzone"// as_
    
};
    
g_tRemoveEntClasses TrieCreate();
    for(new 
ii<sizeof(szRemoveEntClasses); i++)
    {
        
TrieSetCell(g_tRemoveEntClassesszRemoveEntClasses[i], 1);
    }

    
g_iFhDispatchSpawn register_forward(FM_Spawn"OnDispatchSpawn"0);
}

public 
OnDispatchSpawnent )
{
    new 
classname[32];
    
pev(entpev_classnameclassnamecharsmax(classname));
    if( 
TrieKeyExists(g_tRemoveEntClassesclassname) )
    {
        
forward_return(FMV_CELL, -1);
        return 
FMRES_SUPERCEDE;
    }
    return 
FMRES_IGNORED;
}

public 
plugin_init()
{
    
unregister_forward(g_iFhDispatchSpawn);
    
TrieDestroy(g_tRemoveEntClasses);

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode