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

Access to command only on certain flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Adryyy
Member
Join Date: Oct 2011
Old 06-28-2017 , 14:24   Access to command only on certain flags
Reply With Quote #1

Hi. I would like to make an command accessible only on certain flags

Command amx_test, accesbile just for admins with flags "abcdefg" and "hijklmno"
Adryyy is offline
Send a message via Yahoo to Adryyy Send a message via Skype™ to Adryyy
wickedd
Veteran Member
Join Date: Nov 2009
Old 06-28-2017 , 14:50   Re: Access to command only on certain flags
Reply With Quote #2

Read this
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 06-28-2017 , 19:22   Re: Access to command only on certain flags
Reply With Quote #3

just make a flag the plugin has double flags by if get user flag admin_leve_h else admin_level_g ...
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
Adryyy
Member
Join Date: Oct 2011
Old 06-29-2017 , 15:54   Re: Access to command only on certain flags
Reply With Quote #4

No no no
Look, i have this

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

In public 1

....
for(new i;i<2;i++)
{
if(get_user_flags(id)==read_flags(FLAGS[i])) return true
}

But it does not work, does not read
Adryyy is offline
Send a message via Yahoo to Adryyy Send a message via Skype™ to Adryyy
tarkan00
Senior Member
Join Date: Jan 2017
Old 06-29-2017 , 16:59   Re: Access to command only on certain flags
Reply With Quote #5

Quote:
Originally Posted by Adryyy View Post
No no no
Look, i have this

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

In public 1

....
for(new i;i<2;i++)
{
if(get_user_flags(id)==read_flags(FLAGS[i])) return true
}

But it does not work, does not read
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
        
    
}
}


Last edited by tarkan00; 06-29-2017 at 17:00.
tarkan00 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-30-2017 , 02:27   Re: Access to command only on certain flags
Reply With Quote #6

Opting in to FlagManager enables the admin privileges to be overwritten
by the end user via the cmdaccess.ini config file.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 #7

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
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-30-2017 , 08:32   Re: Access to command only on certain flags
Reply With Quote #8

Why not just edit the config file ( cmdaccess)
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-30-2017 at 08:32.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Adryyy
Member
Join Date: Oct 2011
Old 06-30-2017 , 09:42   Re: Access to command only on certain flags
Reply With Quote #9

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
        
    
}
}

Thx. Worked!
Adryyy is offline
Send a message via Yahoo to Adryyy Send a message via Skype™ to Adryyy
tarkan00
Senior Member
Join Date: Jan 2017
Old 06-30-2017 , 12:08   Re: Access to command only on certain flags
Reply With Quote #10

y
Quote:
Originally Posted by DjSoftero View Post
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
        
    

hey bii tch
are you seeing ?
this is good job
if you don't know a work just quiet cunt

Quote:
Originally Posted by Adryyy View Post
Thx. Worked!
your welcome my brother
tarkan00 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 16:30.


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