Author
|
|
AlliedModders Donor
|
Plugin ID:
|
7629
|
Plugin Version:
|
1.0.0
|
Plugin Category:
|
All
|
Plugin Game:
|
Counter-Strike: GO
|
Plugin Dependencies:
|
|
Servers with this Plugin:
|
|
| |
Plugin Description:
|
|
|
|
05-04-2021
, 09:05
[CS:GO] Block Color Chat
|
#1
|
The plugin allows us to block a player's color message if he forces it with a special character.
SourceCode:
Spoiler
PHP Code:
/* [ Includes ] */
#include <sourcemod>
/* [ Compiler Options ] */
#pragma newdecls required
#pragma semicolon 1
/* [ Defines ] */
#define MAX_MESSAGE_LENGTH 512
/* [ Chars ] */
static const char g_sSymbols[][] = { "", "", "", "", "", "", "", "", "", "", "", " " };
// White | Green | Blue | Darkblue | Darkred | Gold | Grey | Lightgreen | Lightred | Lime | Purple | Yellow
/* [ Plugin Author And Informations ] */
public Plugin myinfo = {
name = "[CS:GO] Pawel - [ Block Color Chat ]",
author = "Pawel",
description = "Block color messages for CS:GO servers by Pawel.",
version = "1.0.0",
url = "https://steamcommunity.com/id/pawelsteam"
};
/* [ Message Modify ] */
public Action OnChatMessage(int &iAuthor, Handle hRecipients, char[] sName, char[] sMessage) {
for (int i = 0; i < sizeof(g_sSymbols); i++) {
while (StrContains(sMessage, g_sSymbols[i]) != -1) {
ReplaceString(sMessage, MAX_MESSAGE_LENGTH, g_sSymbols[i], "");
return Plugin_Changed;
}
}
return Plugin_Continue;
}
Last edited by Pawel_SM; 05-04-2021 at 09:08.
|
|
|
|