-
Notifications
You must be signed in to change notification settings - Fork 0
/
GroupsLinks.sp
81 lines (64 loc) · 2.23 KB
/
GroupsLinks.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#pragma semicolon 1
#include <csgo_colors>
#include <sourcemod>
#define VERSION "0.0.1"
#define DEBUG_MODE 0
static const char vkCommand[][] = { "!vk", "vk", "!вк", "вк" };
static const char steamCommand[][] = { "!steam", "steam", "!стим", "стим", "!st", "st" };
static const char discordCommand[][] = { "!discord", "discord", "!дискорд", "дискорд", "!ds", "ds", "!дс", "дс" };
static const char ipCommand[][] = { "!ip", "ip", "!ип", "ип" };
static const char vkSend[] = "Группа в {BLUE}Вконтакте {DEFAULT} links{DEFAULT}";
static const char steamSend[] = "Группа в {BLUE}Steam {DEFAULT} links{DEFAULT}";
static const char discordSend[] = "Группа в {BLUE}Discord {DEFAULT} links{DEFAULT}";
public Plugin : myinfo = {
name = "GroupsLinks",
author = "Danil42Russia",
version = VERSION,
url = "vk.com/danil42russia"
};
public OnPluginStart()
{
#if DEBUG_MODE 1
PrintToServer("Plugin GroupsLinks is load");
PrintToChatAll("Plugin GroupsLinks is load");
#endif
}
public void OnClientSayCommand_Post(int iClient, const char[] command, const char[] sArgs)
{
for (int i; i < sizeof(vkCommand); i++)
{
if (StrEqual(sArgs, vkCommand[i], false)) SentChatVk();
}
for (int i; i < sizeof(steamCommand); i++)
{
if (StrEqual(sArgs, steamCommand[i], false)) SentChatSteam();
}
for (int i; i < sizeof(discordCommand); i++)
{
if (StrEqual(sArgs, discordCommand[i], false)) SentChatDiscord();
}
for (int i; i < sizeof(ipCommand); i++)
{
if (StrEqual(sArgs, ipCommand[i], false)) GetIPAndPort();
}
}
public void SentChatVk()
{
CGOPrintToChatAll(vkSend);
}
public void SentChatSteam()
{
CGOPrintToChatAll(steamSend);
}
public void SentChatDiscord()
{
CGOPrintToChatAll(discordSend);
}
public void GetIPAndPort()
{
char sText[2][128];
int ip = FindConVar("hostip").IntValue;
FormatEx(sText[0], 128, "%d.%d.%d.%d", ip >>> 24 & 255, ip >>> 16 & 255, ip >>> 8 & 255, ip & 255);
GetConVarString(FindConVar("hostport"), sText[1], 128);
CGOPrintToChatAll("IP-адрес и порт сервера - {PURPLE}%s:%s{DEFAULT}", sText[0], sText[1]);
}