cmdaccess.ini & get_user_flags()
I have totally custom cmdaccess.ini.
PHP Code:
What should be the proper value of get_user_flags() to check admin type and also what to check for non-admin users |
Re: cmdaccess.ini & get_user_flags()
Can't exactly understand you. You need to explain it better. As I see it, you just do what you would always do based on your example of cmdaccess.ini.
When you change cmdaccess.ini, you need not edit any plugins to make it work. If an admin has flag "a" then they can use amx_kick. If an admin has flag "g", they can use amx_off. |
Re: cmdaccess.ini & get_user_flags()
^^Thanks mate for quick response.
What I wanted to know is that, how can I check from my Plugin which admin has which flag ?. get_user_flag(id) == ?? And what it would return for normal non-admin players. |
Re: cmdaccess.ini & get_user_flags()
I have found these defines:
PHP Code:
Am I correct ? |
Re: cmdaccess.ini & get_user_flags()
No, users that you do not define as admins will have whatever flags you list in the cvar amx_default_access. Any flag other than Z means, to AMXX, that the user is an admin.
|
Re: cmdaccess.ini & get_user_flags()
So my simple query is with my above cmdaccess.ini how to check Admin and Non-Admin user from amx code.
PHP Code:
|
Re: cmdaccess.ini & get_user_flags()
Ex :
PHP Code:
|
Re: cmdaccess.ini & get_user_flags()
One thing about get_user_flags()
As per documentation it says get_user_flags ( index, id = 0 ) and to read from sever we need to set index = 0 but we always use get_user_flags (id) ie: using 1 argument that is user's id. Is that correct ? |
Re: cmdaccess.ini & get_user_flags()
What are you actually trying to do?????? You are making no sense by referring to the commands listed in cmdaccess.ini. Again, if you change a flag in cmdaccess.ini you do not need to do anything to the plugins unless there is some specific functionality required (I can only think of two situation right now, that is if you want to require that a person have ONLY that single flag or require that they have multiple flags).
If you want to know if a player has a specific flag then you do it like EpicMonkey has showed. Ignore the second argument completely. Just because the second argument is named as "id" it doesn't mean it has anything to do with the "id" that you use as the first argument in a plugin. |
Re: cmdaccess.ini & get_user_flags()
My doubt was if I change Admin access in users.ini I also have to change get_users_flags() with that check.
Now its clear. Admin should have that access which is required for particular plugin cmd to execute and get_users_flags() always checks for fixed access ie: ADMIN_IMMUNITY(a) or ADMIN_CVAR(g). And all these macros are #define in amx inc ie: #define ADMIN_IMMUNITY "a" and so on. |
| All times are GMT -4. The time now is 13:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.