Raised This Month: $18 Target: $400
 4% 

Solved flag validations


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
weffer
Member
Join Date: Oct 2020
Old 08-12-2022 , 15:11   flag validations
Reply With Quote #1

hello,i am trying to do a flag validation currently, the client executing the !test command has the "b" flag assigned but it prints as if the client has the "a" flag what could be the problem.

Code:
RegConsoleCmd("sm_test", cmdTest);
public Action cmdTest(int client, int args) {
	if(CheckCommandAccess(client, "", ADMFLAG_GENERIC) ||
      CheckCommandAccess(client, "", ADMFLAG_RESERVATION))
    {     
      if(CheckCommandAccess(client, "", ADMFLAG_RESERVATION)) {
        CPrintToChatAll("flag a");     
      } else if(CheckCommandAccess(client, "", ADMFLAG_GENERIC)) {        
        CPrintToChatAll("flag b");
      }
    }
}

Last edited by weffer; 08-12-2022 at 17:48.
weffer is offline
Devvii
New Member
Join Date: Aug 2022
Old 08-12-2022 , 16:03   Re: flag validations
Reply With Quote #2

#include <multicolors>
public void OnPluginStart()
{
RegConsoleCmd("sm_test", cmdTest);
}
public Action cmdTest(int client, int args) {
if(CheckCommandAccess(client, "", ADMFLAG_GENERIC) ||
CheckCommandAccess(client, "", ADMFLAG_RESERVATION))
{
if(CheckCommandAccess(client, "a", ADMFLAG_RESERVATION)) {
CPrintToChatAll("flag a");
} else if(CheckCommandAccess(client, "b", ADMFLAG_GENERIC)) {
CPrintToChatAll("flag b");
}
}
}


// Here :>
Devvii is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 08-12-2022 , 17:36   Re: flag validations
Reply With Quote #3

PHP Code:
public void OnPluginStart()
{
    
RegConsoleCmd("sm_test"cmdTest);
}

public 
Action cmdTest(int clientint args)
{
    if(!
client || !IsClientInGame(client) || IsFakeClient(client))
        return 
Plugin_Handled;

    
int flags GetUserFlagBits(client);
    if(
flags ADMFLAG_GENERIC)
        
PrintToChatAll("flag b");
    else if(
flags ADMFLAG_RESERVATION)
        
PrintToChatAll("flag a");

    return 
Plugin_Handled;

__________________
Grey83 is offline
Reply


Thread Tools
Display Modes

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 09:19.


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