-
Notifications
You must be signed in to change notification settings - Fork 0
/
strangehub.sp
69 lines (60 loc) · 1.88 KB
/
strangehub.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
#include <tf2>
#include <tf2_stocks>
#include <tf2attributes>
Handle handles[64];
public Plugin myinfo =
{
name = "Strange kill hub",
description = "Shows Strange Weapon kills in the hud",
author = "Ilowayn",
version = "1.0.0",
url = ""
};
public void OnPluginStart()
{
CreateTimer(0.5, CheckStrangeKills, _, 1);
}
public Action CheckStrangeKills(Handle timer)
{
int i = 1;
while (i <= MaxClients)
{
if (IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i) && IsPlayerAlive(i))
{
if (handles[i])
{
ClearSyncHud(i, handles[i]);
}
else
{
Handle hHudText = CreateHudSynchronizer();
handles[i] = hHudText;
}
int wep = GetEntPropEnt(i, Prop_Send, "m_hActiveWeapon");
if (IsValidEntity(wep))
{
int attriblist[32];
float valuelist[32] = 0.0;
int count_static = TF2Attrib_GetSOCAttribs(wep, attriblist, valuelist);
if (0 < count_static)
{
int x;
while (x <= count_static)
{
if (attriblist[x] == 214)
{
ClearSyncHud(i, handles[i]);
SetHudTextParams(0.8, -0.4, 9999999.0, 0, 255, 0, 255, 0, 6.0, 0.1, 0.2);
char strangeKills[8192];
Format(strangeKills, 8192, "Strange Kill: %d", valuelist[x]);
ShowSyncHudText(i, handles[i], strangeKills);
}
x++;
}
}
}
}
i++;
}
return Plugin_Continue;
}