Raised This Month: $ Target: $400
 0% 

problem with halting the plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-13-2005 , 18:49  
Reply With Quote #6

What PM was saying is that in cmd_live you call cmd_noaccess. Inside of cmd_noaccess you return PLUGIN_HANDLED, and this stops cmd_noaccess, it does NOT stop cmd_live, since you never put a return statement inside of cmd_live itself. Additionally, the cmd_access function will print "You have no access to this command" by itself, so your entire cmd_noaccess function is useless, and it will be printed twice to the client.

When you call cmd_access, the last parameter is how many parameters the comand has, including the command itself. So if you have a command "amx_command <player> <0|1>" you would have a 3 for the last parameter in cmd_access. 1 is amx_comand, 2 is <player>, and 3 is <0|1>. When you do that, if a player only puts in "amx_command <player>", cmd_access will return an error and show the proper usage. This is also another reason why not to print "You do not have access to this command" yourself, as cmd_access may be false for different reasons. So, technically the last parameter in your case should be 1, although it does work with 0.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
 



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 19:22.


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