How can I get the command access flag
How can I retrieve the access level flag from a registered console command?
Example: In the amxcmd.amxx plugin, it registers the slay command as such... Code:
Clear as mud eh? |
Re: How can I get the command access flag
Code:
|
Re: How can I get the command access flag
You're on the right track, but that's not quite what I'm looking for. The line: flag = ADMIN_SLAY says that I KNOW what the command's access flag is. I need to know how to get the access flag of a command if I DON'T know what it is.
Why? With the release of 1.8.0, the access flag can be changed in the cmdaccess.ini file. And I want my new command have the same access level at run time. I suppose I can get it by reading through and finding the command in the cmdaccess.ini file. But I figured there must be an easier way. |
Re: How can I get the command access flag
Type 'amxx cmds' in server console ?
|
Re: How can I get the command access flag
Vet, look closer at Chronic's code. The reason he set flag = ADMIN_SLAY is because by default, it is set to admin_slay.
But above that, it where the real work gets done. get_concmd(i,cmd,31,flag,cmdinfo,7,52428799,-1) That line sets the flag variable. Then it checks if it just set the slay command's info. If so, breaks the loop and leaves you with that flag. If not, keeps going. After it's done looping through all the registered commands, it checks to see if it found the slay command. If not, it sets the flag to admin_slay. |
Re: How can I get the command access flag
Ah, thanks Wilson. I missed the !(NOT) in the if(!registered).
Thanks Chronic. |
| All times are GMT -4. The time now is 01:22. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.