Raised This Month: $51 Target: $400
 12% 

register_concomd with multiple access levels


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-12-2012 , 23:51   Re: register_concomd with multiple access levels
Reply With Quote #11

Try this function:

PHP Code:
public cmdTest(idlevelcid)
{
    if( !
cmd_access(idADMIN_BAN|ADMIN_LEVEL_G|ADMIN_LEVEL_Hcid1) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    
console_print(id"It worked!");

__________________
fysiks is offline
DPT
Member
Join Date: Jun 2011
Old 02-12-2012 , 23:58   Re: register_concomd with multiple access levels
Reply With Quote #12

fysiks, Thanks a lot man.. It finally worked..

Thank you for spending time and being helpful to me.. I really appreciate your help..

And thanks for everyone who spent time helping me on this too..

Thanks again

Last edited by DPT; 02-12-2012 at 23:59.
DPT is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-13-2012 , 01:14   Re: register_concomd with multiple access levels
Reply With Quote #13

One way to test is to try and create a new command (one that doesn't already exist in cmdaccess.ini) making sure you have all the parameters you want set in register_concmd() before running the program. It should work when you use "level" in cmd_access() instead of the ADMIN_ constants.

If it doesn't, then there might be an issue with handling multiple flags in cmdaccess.ini. However, It's been a while since I've looked at AMX Mod X source code and I've never personally explicitly tried to use multiple flags in cmdaccess.ini so I can't say for sure what the problem is.

Somebody who is familiar with AMX Mod X source code could go look and see if "should" work or not.

However, if you are satisfied with my solution above then you don't really need to look further unless you want to be able to change the flags dynamically in cmdaccess.ini without having to recompile your plugin's source code.
__________________

Last edited by fysiks; 02-13-2012 at 01:15.
fysiks is offline
DPT
Member
Join Date: Jun 2011
Old 02-13-2012 , 08:01   Re: register_concomd with multiple access levels
Reply With Quote #14

I'm perfectly fine with your solution.

Thank you
DPT is offline
Reply



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 07:38.


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