-
Notifications
You must be signed in to change notification settings - Fork 0
/
weblinks.sp
56 lines (52 loc) · 1.36 KB
/
weblinks.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
#include <sourcemod>
#include <steamworks>
#pragma semicolon 1
#pragma newdecls required
#define URLPath "https://redirect.hexa-core.eu"
#include "weblinks/globals.sp"
#include "weblinks/client.sp"
#include "weblinks/misc.sp"
#include "weblinks/steamworks.sp"
public Plugin myinfo =
{
name = PLUGIN_NAME,
version = PLUGIN_VERSION,
author = PLUGIN_AUTHOR,
description = "WebLinks is a Web Shortcuts replacement",
url = PLUGIN_URL
};
public void OnPluginStart()
{
arList_WebLinks = new ArrayList(64);
arList_Param = new ArrayList(64);
arList_Address = new ArrayList(512);
}
public void OnMapStart()
{
AddServerToTracker();
LoadWebLinks();
}
public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs)
{
if(IsValidClient(client))
{
if(StrEqual(command, "say") || StrEqual(command, "say_team"))
{
if(StrEqual(sArgs, "motd"))
{
return Plugin_Handled;
}
int iWebLinks = arList_WebLinks.FindString(sArgs);
if(iWebLinks != -1)
{
char sz_Param[64];
char sz_Address[512];
arList_Param.GetString(iWebLinks, sz_Param, sizeof(sz_Param));
arList_Address.GetString(iWebLinks, sz_Address, sizeof(sz_Address));
WebLinks_Initialize(client, sz_Param, sz_Address, sizeof(sz_Address));
return Plugin_Handled;
}
}
}
return Plugin_Continue;
}