register_concomd with multiple access levels
Hello again..
I have a question.. Can cmd_access check a command against multiple access levels? If yes, whats the sytanx exactly? I've tried the following but it didnt work register_concmd("amx_test","cmdTest",ADMIN_BA N & ADMIN_LEVEL_H & ADMIN_LEVEL_G) In some other post, I saw that I should try doing the following register_concmd("amx_test","cmdTest",ADMIN_BA N|ADMIN_LEVEL_H|ADMIN_LEVEL_G) but again it didnt work.. Any help would be appreciated.. |
Re: register_concomd with multiple access levels
&& ?
|
Re: register_concomd with multiple access levels
Quote:
Quote:
If you want to require all of the flags to access the command you can use this version of cmd_access() with the second version of register_concmd() that you posted. PHP Code:
|
Re: register_concomd with multiple access levels
fysiks, I have tried:
PHP Code:
To test even further, I tried this: PHP Code:
Any other alternative? How can i use get_user_flags to properly check if a user has either ADMIN_BAN OR ADMIN_LEVEL_H OR ADMIN_LEVEL_G flag using an if statement? Can you please help? |
Re: register_concomd with multiple access levels
Some of your experiences sound like you didn't update the .amxx file and restarting before trying again.
Any of the ADMIN_ constants can be put together with the | and it will work if the person has at least one of them. What were the flags listed in users.ini of those who tried and it didn't work? |
Re: register_concomd with multiple access levels
Fysiks, I did.. Every time I update my plugin, I restart the server to make sure its updated.. for the users who have the ADMIN_LEVEL_G flag, the flags "fs" are in users.ini ... and for ADMIN_LEVEL_H, the flags in users.ini are "acfit"
|
Re: register_concomd with multiple access levels
Make sure your cmdaccess.ini (configs folder) is updated accordingly.
IIRC, once you register a command (and it is placed in the cmdaccess.ini) and then change the access flags, the cmdaccess.ini is not updated with the new flags; it still contains the old flags from the original register. |
Re: register_concomd with multiple access levels
Emp, to be honest, I did not understand you clearly.. Is there any easier method of checking if the user has either ADMIN_BAN or ADMIN_LEVEL_H or ADMIN_LEVEL_G.. Can't we do it using the get_user_flags function? How would the if statement look like?
This if statement didn't really work: PHP Code:
|
Re: register_concomd with multiple access levels
Quote:
Quote:
Quote:
|
Re: register_concomd with multiple access levels
Alright I did it.. I added the flags to cmdaccess.ini.. the line looks like that now
"test_plugin" "dgh" ; test.amxx I saved it, restarted the server, and tried to access the command. However, I still get a "you have no access to that command" Is there anything else im missing? |
| All times are GMT -4. The time now is 09:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.