Raised This Month: $ Target: $400
 0% 

More Efficient Way in Removing Entities


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-05-2009 , 12:19   More Efficient Way in Removing Entities
Reply With Quote #1

Hi. I wanted to ask which objective entities' removing method is better?
Fakemeta's or Ham's?

Fakemeta:
Code:
#define MAX_OBJECTIVES 15   new g_szObjectiveClassNames[MAX_OBJECTIVES][] = {         "func_bomb_target",         "info_bomb_target",         "info_vip_start",         "func_vip_safetyzone",         "func_escapezone",         "hostage_entity",         "monster_scientist",         "func_hostage_rescue",         "info_hostage_rescue",         "env_fog",         "env_rain",         "env_snow",         "item_longjump",         "func_vehicle",         "func_buyzone" };   new g_iFwdSpawn;   public plugin_precache()         g_iFwdSpawn = register_forward(FM_Spawn, "fwdSpawn");   public plugin_init()         unregister_forward(FM_Spawn, g_iFwdSpawn);   public fwdSpawn(iEnt) {         if (!pev_valid(iEnt))                 return FMRES_IGNORED;           static s_szClassName[32], s_iNum;         pev(iEnt, pev_classname, s_szClassName, 31);           for (s_iNum = 0; s_iNum < MAX_OBJECTIVES; s_iNum++)                 if (equal(s_szClassName, g_szObjectiveClassNames[s_iNum]))                 {                         engfunc(EngFunc_RemoveEntity, iEnt);                           return FMRES_SUPERCEDE;                 }           return FMRES_IGNORED; }
Ham:
Code:
#define MAX_OBJECTIVES 15   new g_szObjectiveClassNames[MAX_OBJECTIVES][] = {         "func_bomb_target",         "info_bomb_target",         "info_vip_start",         "func_vip_safetyzone",         "func_escapezone",         "hostage_entity",         "monster_scientist",         "func_hostage_rescue",         "info_hostage_rescue",         "env_fog",         "env_rain",         "env_snow",         "item_longjump",         "func_vehicle",         "func_buyzone" };   new HamHook:g_iFwdObjectiveSpawn[MAX_OBJECTIVES];   public plugin_precache()         for (new iNum = 0; iNum < MAX_OBJECTIVES; iNum++)                 g_iFwdObjectiveSpawn[iNum] = RegisterHam(Ham_Spawn, g_szObjectiveClassNames[iNum], "fwdObjectiveSpawn");   public plugin_init()         for (new iNum = 0; iNum < MAX_OBJECTIVES; iNum++)                 if (g_iFwdObjectiveSpawn[iNum])                         DisableHamForward(g_iFwdObjectiveSpawn);   public fwdObjectiveSpawn(iEnt)         return pev_valid(iEnt) ? HAM_SUPERCEDE : HAM_IGNORED;
Note that I include both Fakemeta & Ham Sandwich in my plugin & I don't use Engine.

Also I wonder if I'm disabling Ham's forwards right.
__________________
hleV is offline
 


Thread Tools
Display Modes

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 23:37.


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