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

Restrict buying?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Misery
Senior Member
Join Date: Dec 2010
Old 12-07-2011 , 12:43   Restrict buying?
Reply With Quote #1

Hi,

I inspected the restmenu.sma plugin.
However, I do not understand yet very well the principles...
I mean... I don't see a function explicitely called which actually does the restricting job.
I assume it's something else.

Could anyone explain me, in short, how it works? Does it restrict buying by catching an event or something?

Thanks!

Misery
Misery is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-07-2011 , 13:38   Re: Restrict buying?
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=149380

+ #6 where you can find orpheu way with less code.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Misery
Senior Member
Join Date: Dec 2010
Old 12-28-2011 , 02:45   Re: Restrict buying?
Reply With Quote #3

Connor, thanks for this link.
As the question was stating, I wanted to know how restrict.amxx works. I see restrict.amxx does not use the same code/way.

It catches aliases, old menu binds (menuselect and so on) and autobuy calls by the use of public_command().
You method seems to have less code? COuld you brievly explain how it works? Does it catches the buy attempts in a lower level? Is it faster?

Thanks!

Last edited by Misery; 12-28-2011 at 02:46.
Misery is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 12-28-2011 , 03:39   Re: Restrict buying?
Reply With Quote #4

Yes it's more efficient and hooks stuff at a lower level.
AMXX doesn't have orpheu by default so it can't use it in it's default plugins
Also, some default plugins still use get_cvar_*() which is terribly slow compared to get_pcvar_*()...
__________________

Last edited by Hunter-Digital; 12-28-2011 at 03:40.
Hunter-Digital is offline
Misery
Senior Member
Join Date: Dec 2010
Old 12-28-2011 , 03:51   Re: Restrict buying?
Reply With Quote #5

Quote:
Originally Posted by Hunter-Digital View Post
AMXX doesn't have orpheu by default so it can't use it in it's default plugins
Dude, I'm not talking about the Orpheu method here! I will not use orpheu in my plugin, not that I have something wrong with it, but I want to do it without it, for purist reasons: I don't wanna hook another mm dll just for using it with one plugin, even if the additional memory usage is not noticeable.

Besides, what I was asking is... In *connor's original cl_buy forward*, is it lower level? and... ____how is the concept different than restrict.amxx________

Thanks!
Misery
Misery is offline
TETYYS
Junior Member
Join Date: Oct 2011
Old 12-28-2011 , 06:12   Re: Restrict buying?
Reply With Quote #6

PHP Code:
remove_entities("func_buyzone"); 

Last edited by TETYYS; 12-28-2011 at 06:13.
TETYYS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-28-2011 , 12:13   Re: Restrict buying?
Reply With Quote #7

My way hooks :

- menuselect commands and then check if the players is in an buy menu (old menu style)
- alias commands, those commands are sent via regular commands for :
  1. aliases
  2. VGUI buy menu
And they are sent via CS_Internal_Command function for rebuy and autobuy


I'm not sure how restrict.amxx works for VGUI menu, but for old style menu, it make its own menu, for aliases i think a Trie (my way) is a bit mroe efficient.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 07:24.


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