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

Can a Author help me?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Darkwob
BANNED
Join Date: Oct 2018
Old 05-28-2021 , 16:00   Can a Author help me?
Reply With Quote #1

My goal is to give a tag next to the nickname of top 50 players, but when players with a tag, for example, admin, mod, owner or vip players write something in the chat, it says double. how can i prevent this? I need to make sure it has both tags. Also "@ and /" appear in the conversation when I use these symbols. When I type in team chat, it also appears in global chat.


Errors
Quote:
1.If a Player has a hashtag it drops as a double message to the chat.(Owner,Admin,Mod or Vip)
2.When she writes to Team Chat, it also texts the global chat.
3-The rank should only appear in the Global chat, while it only appears in the Team chat. I could not prevent this.
What I am trying to do is when a player posts a message to the global chat.
This normal player
[RANK-3]Nickname
This is the player with a Tag too.
Owner
[RANK-3][O]Nickname
VIP
[RANK-3][V]Nickname
ADMIN
[RANK-3][A]Nickname
MOD
[RANK-3][M]Nickname
Rank will not appear if he writes to Team Chat. If this player does not have a tag, he will write in color when writing in the team chat.

PHP Code:
public Action cmd_Say(int clientint args
{
  
char Text[255];
  
char Name[MAX_NAME_LENGTH];
  
//char Command[64];
  
int Start 0;

  
GetCmdArgString(Textsizeof(Text));

  
int TextLen strlen(Text);

  
// This apparently happens sometimes?
  
if (TextLen <= 0) {
    return 
Plugin_Continue;
  }

  if (
Text[TextLen 1] == '"') {
    
Text[TextLen 1] = '\0';
    
Start 1;
  }
  
  if (
ClientRank[client] > 0)
  {
    if( 
ClientRank[client] > && ClientRank[client] <= 50 )
    {
        
        
        
GetClientName(clientNamesizeof(Name));
        
GetCmdArgString(Textsizeof(Text));
        
Text[strlen(Text)-1] = '\0';
        
PrintToChatAll("\x04[\x01\x03RANK-%i\x01\x04]\x01\x05%s:"ClientRank[client], Name);
        
    }    
  } 

This is the Plugin I Tag Players.


PHP Code:
public Action OnPlayerChatCheck(int client, const char[] commandint args)
{
    if (
client == || args == 0)
    {
        return 
Plugin_Continue;
    }
    
    if (!
IsClientInGame(client))
    {
        return 
Plugin_Handled;
    }
    
    
char sChatText[384];
    
GetCmdArgString(sChatTextsizeof(sChatText));
    
StripQuotes(sChatText);
    
    if ((
GetUserFlagBits(client) & ADMFLAG_ROOT))
    {
        if (
sChatText[0] == '/')
        {
            return 
Plugin_Handled;
        }
        
        
PrintToChatAll("\x04[OWNER] \x05%N\x01: %s"clientsChatText);
        return 
Plugin_Handled;
    } 
If he writes in team chat

PHP Code:
    public Action OnPlayerTeamChatCheck(int client, const char[] commandint args)
    {
    if(
client == || args == 0)
    {
    return 
Plugin_Continue;
    }
    
    if (!
IsClientInGame(client))
    {
     return 
Plugin_Handled;
    }

    
char sChatText[384];
    
GetCmdArgString(sChatTextsizeof(sChatText));
    
StripQuotes(sChatText);
    
    if ((
GetUserFlagBits(client) & ADMFLAG_ROOT))
    {
     if (
sChatText[0] == '/')
     {
     return 
Plugin_Handled;
     }
     for (
int i 1<= MaxClientsi++)
     {
            if (!
IsClientInGame(i) || GetClientTeam(i) != GetClientTeam(client) || IsFakeClient(i))
            {
                continue;
            }
      
PrintToChat(i"\x03%s \x04[O]\x05 %N\x01: %s", (GetClientTeam(client) != 2) ? ((GetClientTeam(client) == 3) ? "(Infected)" "(Spectators)") : "(Survivors)"clientsChatText)
     }
     return 
Plugin_Handled;
  } 


Last edited by Darkwob; 05-28-2021 at 16:04.
Darkwob 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 17:39.


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