Raised This Month: $ Target: $400
 0% 

Access to command only on certain flags


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 06-30-2017 , 07:38   Re: Access to command only on certain flags
Reply With Quote #6

Quote:
Originally Posted by tarkan00 View Post
hey bro you can use this :
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "flags plugin"
#define VERSION "1.0"
#define AUTHOR "tarkan"

new const FLAGS[2][]=
{
"abcdefg",//flags 1
"hijklmno"//flags 2
}

public 
plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)

register_clcmd("say /test","calis")
}
public 
calis(id)
{
for(new 
0sizeof FLAGSi++){
    if(
get_user_flags(id) == read_flags(FLAGS[i])){
        
///////////////////////    your cmds
        ///////////////////////    your cmds
        ///////////////////////    your cmds
        
    
}
}

pretty sure you cant compare returned data of get_user_flags(id) wth a string. You would have to do smth like:
PHP Code:
new flags get_user_flags(id)
if(
flags ADMIN_LEVEL_H || flags ADMIN_RCON ){//etc. i`m not very familiar with bitsums, so i might kinda be wrong. but comparing it to string is rly not the way to do it.
        ///////////////////////    your cmds
        ///////////////////////    your cmds
        ///////////////////////    your cmds
        
    

__________________
retired chump
DjSoftero is offline
 



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 01:31.


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