include amxmodx include amxmisc include hamsandwich include dhudmessag

 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
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <dhudmessage>
#include <fakemeta>
#include <cstrike>
#define PLUGIN "Frags on round"
#define VERSION "1.0"
#define AUTHOR "chmod"
#pragma tabsize 0
#define ICON_SHOW 1
#define ICON_HIDE 0
#define ICON_UPD 2
#define RED 255
#define GREEN 255
#define BLUE 0
new frags[33]
new gMsgID
public plugin_init(){
register_plugin( PLUGIN, VERSION, AUTHOR );
RegisterHam(Ham_Killed, "player", "onKill")
RegisterHam(Ham_Spawn, "player", "spawn", 1);
gMsgID = get_user_msgid("StatusIcon")
}
public onKill(victim, attacker, corpse){
//make screen fade
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, attacker)
write_short(1<<10)
write_short(1<<10)
write_short(0x0003)
write_byte(30)
write_byte(144)
write_byte(255)
write_byte(75)
message_end()
//remove old number
new s_sprite[33]
format(s_sprite, 32, "number_%d", frags[attacker])
message_begin(MSG_ONE, gMsgID, {0,0,0}, attacker)
write_byte(ICON_HIDE)
write_string(s_sprite)
message_end()
//setting new number
frags[attacker]++
format(s_sprite, 32, "number_%d", frags[attacker])
message_begin(MSG_ONE, gMsgID, {0,0,0}, attacker)
write_byte(ICON_SHOW)
write_string(s_sprite)
write_byte(RED)
write_byte(GREEN)
write_byte(BLUE)
message_end()
}
public spawn(id){
//remove frags on spawn player
frags[id] = 0
message_begin(MSG_ONE, gMsgID, {0,0,0}, id)
write_byte(ICON_SHOW)
write_string("number_0")
write_byte(RED)
write_byte(GREEN)
write_byte(BLUE)
message_end()
}