Raised This Month: $51 Target: $400
 12% 

Blocking Buy Commands (Basic)


Post New Thread Reply   
 
Thread Tools Display Modes
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 10-15-2009 , 07:01   Re: Blocking Buy Commands (Basic)
Reply With Quote #21

Quote:
Originally Posted by Arkshine View Post
No, RegisterHam() should hook only by the the classname provided.
You are wrong. Sawce never meant it to search for entities' classnames.
The whole system has nothing to do with in-game classname. The native creates a temp entity with the classname provided which virtual table it hooks. Like that it can't even detect anything related to that.
Quote:
Originally Posted by Arkshine View Post
I don't see the purpose for both to hook by internal class. (why both natives so?)
RegisterHamFromEntity wasn't created in the first place, but was added later. That's because it came to known that all entities has no code class. Like CZ bots which have the classname of "player" can't be hooked without RegisterHamFromEntity.
Quote:
Originally Posted by Arkshine View Post
If not a bug RegisterHam() (I don't see in the .inc a note like : "This will cause hooks for the entire internal class" why?) should still hook only the classname we provide. It makes more senses to use it in this way. In many situations that's not possible to use Ham_Spawn when it's more efficient to use it. Using FM_Spawn called for all entities + using a native each time as replacement is just idiot.
We never have all the options, but we must use the way which is better in the situation.
SnoW is offline
Send a message via MSN to SnoW
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-15-2009 , 07:32   Re: Blocking Buy Commands (Basic)
Reply With Quote #22

Quote:
We never have all the options, but we must use the way which is better in the situation.
Still, even if it's the normal behaviour, it would be nice if possible to filter by entity class name. It's just a waste in such situation. :/
__________________
Arkshine is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-31-2009 , 10:22   Re: Blocking Buy Commands (Basic)
Reply With Quote #23

What about this method?
PHP Code:
#include <amxmodx>
#include <engine>
 
public plugin_init()
{
        new 
iEnt = -1;
 
        while ((
iEnt find_ent_by_class(iEnt"func_buyzone")))
                
entity_set_int(iEntEV_INT_team3);

__________________

Last edited by hleV; 10-31-2009 at 14:07. Reason: Optimized.
hleV is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 10-31-2009 , 12:08   Re: Blocking Buy Commands (Basic)
Reply With Quote #24

I think it won't work
KadiR is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 10-31-2009 , 13:17   Re: Blocking Buy Commands (Basic)
Reply With Quote #25

I believe player spawns will work as buy zones if entity for it isn't created. Though I don't know if moving them unreachable would work.
SnoW is offline
Send a message via MSN to SnoW
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-31-2009 , 13:49   Re: Blocking Buy Commands (Basic)
Reply With Quote #26

Quote:
Originally Posted by KadiR View Post
I think it won't work
It works. I'm asking if it's efficient.
__________________
hleV is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 10-31-2009 , 15:20   Re: Blocking Buy Commands (Basic)
Reply With Quote #27

Did you read this?

Quote:
Originally Posted by SnoW View Post
I believe player spawns will work as buy zones if entity for it isn't created. Though I don't know if moving them unreachable would work.
KadiR is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-31-2009 , 16:21   Re: Blocking Buy Commands (Basic)
Reply With Quote #28

Yes. So?
__________________
hleV is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 10-31-2009 , 16:33   Re: Blocking Buy Commands (Basic)
Reply With Quote #29

... or you could change the team yes. My post looks weird because of your edit.
SnoW is offline
Send a message via MSN to SnoW
Bos93
Veteran Member
Join Date: Jul 2010
Old 06-27-2013 , 08:55   Re: Blocking Buy Commands (Basic)
Reply With Quote #30

How best to block VGUI menus?

I think this is not the best option:

PHP Code:
public client_connectpPlayer 
{
        
set_user_infopPlayer"_vgui_menus""0" );


And this option is not very good:

PHP Code:
message_beginMSG_ONEget_user_msgid"BuyClose" ), _Player );
message_end( ); 
I need to show a new menu.
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
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 03:44.


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