Custom message in console when access is denied
Hi, I'm trying to keep a plugin available to people with ADMIN_RESERVATION only. So far so good, but I also want people that don't have this flag to get a custom message instead of the default "You don't have access to this command."
I tried this : Code:
Code:
hlmp.sma(179) : warning 225: unreachable code |
Take out the first return.
|
Code:
|
Quote:
Also I would recomend console_print, just cause I like it better :) Code:
|
The problem with that is that cmd_access will print "You have no access to that command" anyways, so your message will come after it, and then it will stop.
|
You guys are fast...
Thanks for all the help, I picked jtp10181's one and it works like a charm. It works like Hawk552 predicted, but in this case it is perfect. |
I recommend you stick with client_print and ignore jtp's recommendation to use console_print, just because that's my preference. :lol:
psst... use whichever you prefer. |
:lol:
Anyway, I have another question related to user flags. This time I'd like to prevent something to be forced on admins that have ADMIN_IMMUNITY. It's about this piece of code: Code:
Code:
|
Code:
fyi you need the amxmisc.inc to use the "access" function |
Your suggestion works, but not consistently. As soon as I change my name forceforumname is performed on me, regardless my immunity.
amxmisc.inc is already included. What would the code look like if I use that method ? Something like this ? Code:
edit : no, that doesn't work at all. Although it compiles fine. |
| All times are GMT -4. The time now is 23:40. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.