Raised This Month: $ Target: $400
 0% 

More Efficient Way in Removing Entities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-05-2009 , 12:34   Re: More Efficient Way in Removing Entities
Reply With Quote #1

Well connor he unregisters forward at plugin_init
__________________
xPaw is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 05-05-2009 , 12:45   Re: More Efficient Way in Removing Entities
Reply With Quote #2

Quote:
Originally Posted by xPaw View Post
Well connor he unregisters forward at plugin_init
cuz its unnecesarry code, with engine its one line per per ent or a 2 line loop.
anyway, "static s_szClassName[32] -> newszClassName[32]". you should not use a static there cuz it will still exist after FM_Spawn is run.

edit: you were faster... fakemeta engfunc( EngFunc_RemoveEntity, ent );
i guess youll have to do this in FM_Spawn or FM_KeyValue, at least spawns which are created after are not registered to the cs engine (changing an existing spawn, for example a ter spawn to ct spawn works!). maybe you can even use FMRES_SUPERCEDE.
__________________

Last edited by SchlumPF*; 05-05-2009 at 12:48.
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 05-05-2009 , 16:13   Re: More Efficient Way in Removing Entities
Reply With Quote #3

Quote:
Originally Posted by SchlumPF* View Post
anyway, "static s_szClassName[32] -> newszClassName[32]". you should not use a static there cuz it will still exist after FM_Spawn is run.
It doesn't matter, he gets the classname and sets it in szClassName so every time FM_Spawn is called the value is changed, not saved.
If you want it to be constant, you can do this:
PHP Code:
static var;
if (!var)
      var = 
8// Set it for the first time. 
Unless you mean that he unregisters FM_Spawn and the var will still exist?
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Reply



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