Raised This Month: $ Target: $400
 0% 

ADD flag A to players who get VIP tag HELP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alex101192
Senior Member
Join Date: Aug 2018
Old 11-06-2020 , 05:43   ADD flag A to players who get VIP tag HELP
Reply With Quote #1

There is a problem with this code here. It displays admin tag just fine but not for flag A vips since it's missing the reservation check. So I put ADMFLAG_RESERVATION inside the else if but nothing happened. Help please.

Code:
public void OnPluginStart()
{
    AddCommandListener(OnPlayerChatCheck, "say");
    AddCommandListener(OnPlayerTeamChatCheck, "say_team");
}

public void OnPluginEnd()
{
    RemoveCommandListener(OnPlayerChatCheck, "say");
    RemoveCommandListener(OnPlayerTeamChatCheck, "say_team");
}

public Action OnPlayerChatCheck(int client, const char[] command, int args)
{
    if (client == 0 || args == 0)
    {
        return Plugin_Continue;
    }
    
    if (!IsClientInGame(client))
    {
        return Plugin_Handled;
    }
    
    char sChatText[192];
    GetCmdArgString(sChatText, sizeof(sChatText));
    StripQuotes(sChatText);
    
    if ((GetUserFlagBits(client) & ADMFLAG_GENERIC) || (GetUserFlagBits(client) & ADMFLAG_KICK) || (GetUserFlagBits(client) & ADMFLAG_ROOT))
    {
        if (sChatText[0] == '/')
        {
            return Plugin_Handled;
        }
        
        PrintToChatAll("\x04[ADMIN] \x05%N\x01: %s", client, sChatText);
        return Plugin_Handled;
    }
    else if ((GetUserFlagBits(client) & ADMFLAG_CUSTOM1) || (GetUserFlagBits(client) & ADMFLAG_CUSTOM2) || (GetUserFlagBits(client) & ADMFLAG_CUSTOM3) || (GetUserFlagBits(client) & ADMFLAG_CUSTOM4) || (GetUserFlagBits(client) & ADMFLAG_CUSTOM5) || (GetUserFlagBits(client) & ADMFLAG_CUSTOM6))
    {
        if (sChatText[0] == '/')
        {
            return Plugin_Handled;
        }
        
        PrintToChatAll("\x04[VIP] \x05%N\x01: %s", client, sChatText);
        return Plugin_Handled;
    }
    
    return Plugin_Continue;
}

public Action OnPlayerTeamChatCheck(int client, const char[] command, int args)
{
    if (client == 0 || args == 0)
    {
        return Plugin_Continue;
    }
    
    if (!IsClientInGame(client))
    {
        return Plugin_Handled;
    }
    
    char sChatText[192];
    GetCmdArgString(sChatText, sizeof(sChatText));
    StripQuotes(sChatText);
    
    if ((GetUserFlagBits(client) & ADMFLAG_GENERIC) || (GetUserFlagBits(client) & ADMFLAG_KICK) || (GetUserFlagBits(client) & ADMFLAG_ROOT))
    {
        if (sChatText[0] == '/')
        {
            return Plugin_Handled;
        }
        
        for (int i = 1; i <= MaxClients; i++)
        {
            if (!IsClientInGame(i) || GetClientTeam(i) != GetClientTeam(client) || IsFakeClient(i))
            {
                continue;
            }
            
            PrintToChat(i, "\x03%s \x04[A]\x05 %N\x01: %s", (GetClientTeam(client) != 2) ? ((GetClientTeam(client) == 3) ? "(Infected)" : "(Spectators)") : "(Survivors)", client, sChatText);
        }
        return Plugin_Handled;
    }
    else if ((GetUserFlagBits(client) & ADMFLAG_CUSTOM1) || (GetUserFlagBits(client) & ADMFLAG_CUSTOM2) || (GetUserFlagBits(client) & ADMFLAG_CUSTOM3) || (GetUserFlagBits(client) & ADMFLAG_CUSTOM4) || (GetUserFlagBits(client) & ADMFLAG_CUSTOM5) || (GetUserFlagBits(client) & ADMFLAG_CUSTOM6))
    {
        if (sChatText[0] == '/')
        {
            return Plugin_Handled;
        }
        
        for (int i = 1; i <= MaxClients; i++)
        {
            if (!IsClientInGame(i) || GetClientTeam(i) != GetClientTeam(client) || IsFakeClient(i))
            {
                continue;
            }
            
            PrintToChat(i, "\x03%s \x04[VIP]\x05 %N\x01: %s", (GetClientTeam(client) != 2) ? ((GetClientTeam(client) == 3) ? "(Infected)" : "(Spectators)") : "(Survivors)", client, sChatText);
        }
        return Plugin_Handled;
    }
    
    return Plugin_Continue;
}

Last edited by Alex101192; 11-06-2020 at 05:44.
Alex101192 is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 11-06-2020 , 13:43   Re: ADD flag A to players who get VIP tag HELP
Reply With Quote #2

i m not quite follow, but assuming the flag A carry the tag VIP then the argument ADMFLAG_RESERVATION goes in line with ADMFLAG_CUSTOM1 follow by || (or operator). Have you try?

Edit: This belong to the moon landing engineering team scripting section.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 11-06-2020 at 13:45.
GsiX 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 05:44.


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