Raised This Month: $ Target: $400
 0% 

Restrict function...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LynX
Veteran Member
Join Date: Oct 2004
Old 03-26-2005 , 03:35   Restrict function...
Reply With Quote #1

How the heck I can restrict some function? Let's say, mine function called "stickgun" is active. If it is active, the plugin restricts to use commands like "Duck" , "menu", etc... But if I call another function restriction will dissapear. So, how can I restrict functions if mine is active?
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-26-2005 , 04:05  
Reply With Quote #2

If you are using register_clcmd or register_concmd and returning PLUGIN_HANDLED, make sure your plugin is at the top of the list (or above any other plugins that may be catching the same command).
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
LynX
Veteran Member
Join Date: Oct 2004
Old 03-26-2005 , 04:20  
Reply With Quote #3

Ermm, I doubt mine plugin will be at top of the list... So is there any other way?
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
Jinto
Member
Join Date: Jun 2004
Location: Seattle, WA
Old 03-26-2005 , 09:04  
Reply With Quote #4

If you are sure no other plugins are intercepting that command then it can be anywhere. But if you are not sure just in a readme file or something warn them if they do not place it as the first plugin problems can arise.

Anyway I use the same method for blocking certain actions. I just supercede the command if I'm doing action a and don't want action b called.
Jinto is offline
Send a message via ICQ to Jinto Send a message via AIM to Jinto Send a message via MSN to Jinto Send a message via Yahoo to Jinto
LynX
Veteran Member
Join Date: Oct 2004
Old 03-26-2005 , 11:11  
Reply With Quote #5

Erm, can some1 show me a code snippet?
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
Jinto
Member
Join Date: Jun 2004
Location: Seattle, WA
Old 03-27-2005 , 02:30  
Reply With Quote #6

This is how I block the powerup in esf if I don't want them using it. ( I'm using metamod but here is an amxx snippet ).

Code:
public plugin_init( ) {
     register_clcmd( "+powerup", "powerup" );
     register_clcmd( "-powerup", "powerup" );
}

public powerup( id, level, cid ) {
     if( ACTIONA ) {
          return PLUGIN_HANDLED;
     }
     
     return PLUGIN_CONTINUE;
}
Jinto is offline
Send a message via ICQ to Jinto Send a message via AIM to Jinto Send a message via MSN to Jinto Send a message via Yahoo to Jinto
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 09:59.


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