-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtf2_4chan_quoter.sp
65 lines (49 loc) · 1.32 KB
/
tf2_4chan_quoter.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma semicolon 1
#include <sourcemod>
#include <tf2>
#define PLUGIN_VERSION "1.0.0"
#define PLUGIN_VERSION_CVAR "sm_4chquoter_version"
public Plugin myinfo =
{
name = "[TF2] Imageboard Green Text",
author = "2010kohtep",
description = "Print quote-styled text in global chat.",
version = PLUGIN_VERSION,
url = "https://github.com/2010kohtep"
};
ConVar g4chVersion;
public void OnPluginStart()
{
AddCommandListener(OnSay, "say");
g4chVersion = CreateConVar(PLUGIN_VERSION_CVAR, PLUGIN_VERSION, "Plugin version.", FCVAR_SPONLY | FCVAR_NOTIFY | FCVAR_PRINTABLEONLY);
}
public Action OnSay(client, const String:command[], argc)
{
if(!client || client > MaxClients || !IsClientInGame(client))
return Plugin_Continue;
decl String:text[128];
GetCmdArgString(text, sizeof(text));
StripQuotes(text);
if (text[0] == '>')
{
decl String:output[256];
switch (GetClientTeam(client))
{
case TFTeam_Blue:
{
Format(output, sizeof(output), "\x0799CCFF%N\x01 : \x05%s", client, text);
}
case TFTeam_Red:
{
Format(output, sizeof(output), "\x07FF4040%N\x01 : \x05%s", client, text);
}
default:
{
Format(output, sizeof(output), "\x07CCCCCC%N\x01 : \x05%s", client, text);
}
}
PrintToChatAll(output);
return Plugin_Handled;
}
return Plugin_Continue;
}