-
Notifications
You must be signed in to change notification settings - Fork 6
/
shipchat.sp
47 lines (39 loc) · 1.07 KB
/
shipchat.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
#pragma semicolon 1
#include <sourcemod>
public Plugin:myinfo =
{
name = "TheShip Chat",
author = "Stevo.TVR",
description = "Converts chat in TheShip to regular chat that plugins recognize",
version = "1.1",
url = "http://www.theville.org"
}
#define CHAT_SYMBOL '@'
#define SILENT_TRIGGER '!'
public OnPluginStart()
{
RegConsoleCmd("say", Command_Say);
}
public Action:Command_Say(client, args)
{
new String:text[192], String:prefix[8], startidx;
if (GetCmdArgString(text, sizeof(text)) < 1 || client == 0)
{
return Plugin_Continue;
}
StripQuotes(text);
startidx = SplitString(text, " ", prefix, sizeof(prefix));
if(StrEqual(prefix, "/p", true))
{
FakeClientCommandEx(client, "say %s", text[startidx]);
if(text[startidx] == CHAT_SYMBOL || text[startidx] == SILENT_TRIGGER)
return Plugin_Handled;
}
else if(StrEqual(prefix, "/t", true) || StrEqual(prefix, "/i/s", true))
{
FakeClientCommandEx(client, "say_team %s", text[startidx]);
if(text[startidx] == CHAT_SYMBOL || text[startidx] == SILENT_TRIGGER)
return Plugin_Handled;
}
return Plugin_Continue;
}