Raised This Month: $ Target: $400
 0% 

More Efficient Way in Removing Entities


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 06-05-2009 , 10:40   Re: More Efficient Way in Removing Entities
Reply With Quote #9

Code:
#include <amxmodx> #include <fakemeta> new const entities_to_be_removed[][] = {     "info_player_deathmatch",     "info_player_vip" } new fow_keyvalue public plugin_init() {     register_plugin( "plugin", "version", "author" )     unregister_forward(FM_KeyValue,fow_keyvalue,0) } public plugin_precache() {     fow_keyvalue = register_forward(FM_KeyValue,"fm_keyvalue",0) } public fm_keyvalue(ent,kvdid) {     static key[24], value[24]     get_kvd(kvdid,KV_KeyName, key,23)     get_kvd(kvdid,KV_Value, value,23)     if(equal(key,"classname")) {         for(new i = 0; i < sizeof entities_to_be_removed; i++) {             if(equal(value,entities_to_be_removed[i])) {                 set_kvd(kvdid,KV_Value,  "lol123")  //invalid classname makes engine remove the entity             }         }     }     return FMRES_IGNORED }

Code:
#include <amxmodx> #include <fakemeta> new const g_class[] =   "func_bomb_target"  //must be valid classname, otherwise crash! public plugin_init() {     register_plugin( "plugin", "version", "author") } public plugin_precache() {     new ent = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,g_class))     set_pev(ent,pev_solid, SOLID_NOT) }

I don't know where i got these codes but i've been using them.
__________________
[X]-RayCat 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