-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeath_event.sma
135 lines (120 loc) · 4.51 KB
/
death_event.sma
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#include <amxmodx>
#include <hamsandwich>
#include <csx>
#define MAX_PLAYERS 32
new give_dmg[MAX_PLAYERS][MAX_PLAYERS];
new give_hit[MAX_PLAYERS][MAX_PLAYERS];
public plugin_init()
{
register_plugin("Victim Tell", "1.0.0", "Dimas");
RegisterHam(Ham_Spawn, "player", "spawnPlayer", 1);
}
public spawnPlayer(id) {
static i;
for (i = 0; i < MAX_PLAYERS; i++) {
give_dmg[id][i] = 0;
give_hit[id][i] = 0;
give_dmg[i][id] = 0;
give_hit[i][id] = 0;
}
}
public client_damage(attacker, victim, damage, wpnindex, hitplace, TA)
{
switch (1 <= victim <= MAX_PLAYERS && 1 <= attacker <= MAX_PLAYERS && victim != attacker) {
case 1: {
switch (is_user_alive(attacker)) {
case 1: {
give_dmg[attacker][victim] += damage;
give_hit[attacker][victim] += 1;
}
}
}
}
/*
if (1 <= victim <= MAX_PLAYERS && 1 <= attacker <= MAX_PLAYERS && victim != attacker) {
if (is_user_alive(attacker)) {
give_dmg[attacker][victim] += damage;
give_hit[attacker][victim] += 1;
}
}
*/
}
public client_death(killer, victim, wpnindex, hitplace, TK)
{
switch (1 <= killer <= MAX_PLAYERS && 1 <= victim <= MAX_PLAYERS && killer != victim) {
case 1: {
static isHs;
isHs = hitplace == HIT_HEAD;
switch (is_user_bot(killer)) {
case 0: {
static victimName[32];
get_user_name(victim, victimName, 31);
// client_cmd(killer, "spk ^"%s^"", KILL_DING_SOUND);
set_hudmessage(255, 255, 255, 0.8, 0.2, 0, 0.0, 0.1, 0.0, 3.9, 4);
show_hudmessage(killer, "%s: %s^n%i in %i %s",
isHs ? "HS" : "Dead",
victimName,
give_dmg[killer][victim],
give_hit[killer][victim],
give_hit[killer][victim] == 1 ? "hit" : "hits"
);
}
}
switch (is_user_bot(victim)) {
case 0: {
static killerName[32], weaponName[32];
get_user_name(killer, killerName, 31);
get_weaponname(wpnindex, weaponName, 31);
set_hudmessage(255, 255, 255, -1.0, 0.6, 0, 0.0, 3.0, 0.0, 0.5, 3);
show_hudmessage(victim, "%s | %s%s^nYou took %i in %i %s^nYou gave %i in %i %s",
killerName,
weaponName,
isHs ? " (HS)" : "",
give_dmg[killer][victim],
give_hit[killer][victim],
give_hit[killer][victim] == 1 ? "hit" : "hits",
give_dmg[victim][killer],
give_hit[victim][killer],
give_hit[victim][killer] == 1 ? "hit" : "hits"
);
}
}
}
}
/*
if (1 <= killer <= MAX_PLAYERS && 1 <= victim <= MAX_PLAYERS && killer != victim) {
static isHs;
isHs = hitplace == HIT_HEAD;
if (!is_user_bot(killer)) {
static victimName[32];
get_user_name(victim, victimName, 31);
// client_cmd(killer, "spk ^"%s^"", KILL_DING_SOUND);
set_hudmessage(255, 255, 255, 0.8, 0.2, 0, 0.0, 0.1, 0.0, 3.9, 4);
show_hudmessage(killer, "%s: %s^n%i in %i %s",
isHs ? "HS" : "Dead",
victimName,
give_dmg[killer][victim],
give_hit[killer][victim],
give_hit[killer][victim] == 1 ? "hit" : "hits"
);
}
if (!is_user_bot(victim)) {
static killerName[32], weaponName[32];
get_user_name(killer, killerName, 31);
get_weaponname(wpnindex, weaponName, 31);
set_hudmessage(255, 255, 255, -1.0, 0.6, 0, 0.0, 3.0, 0.0, 0.5, 3);
show_hudmessage(victim, "%s | %s%s^nYou took %i in %i %s^nYou gave %i in %i %s",
killerName,
weaponName,
isHs ? " (HS)" : "",
give_dmg[killer][victim],
give_hit[killer][victim],
give_hit[killer][victim] == 1 ? "hit" : "hits",
give_dmg[victim][killer],
give_hit[victim][killer],
give_hit[victim][killer] == 1 ? "hit" : "hits"
);
}
}
*/
}