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

Solved flag validations


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
weffer
Member
Join Date: Oct 2020
Old 08-12-2022 , 14: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 16:48.
weffer is offline
Devvii
BANNED
Join Date: Aug 2022
Location: GB
Old 08-12-2022 , 15: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
Send a message via ICQ to Devvii Send a message via AIM to Devvii Send a message via Yahoo to Devvii Send a message via Skype™ to Devvii
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 08-12-2022 , 16: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



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:42.


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