This repository has been archived by the owner on Jan 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bb_cheer.sma
152 lines (125 loc) · 3.97 KB
/
bb_cheer.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#include <amxmodx>
#include <cstrike>
#include <colorchat>
new const cheerpath[][] = { "zmParadise/cheer/cheer_1.wav", "zmParadise/cheer/cheer_2.wav", "zmParadise/cheer/cheer_3.wav", "zmParadise/cheer/cheer_4.wav", "zmParadise/cheer/cheer_5.wav", "zmParadise/cheer/cheer_6.wav", "zmParadise/cheer/cheer_7.wav", "zmParadise/cheer/cheer_8.wav", "zmParadise/cheer/cheer_9.wav", "zmParadise/cheer/cheer_10.wav" }
new const jeerpath[] = { "zmParadise/cheer/jeer.wav" }
new const bakapath[] = { "zmParadise/cheer/cirno.wav" }
new Float:lastcheer[33]
native zpm_models_get_selection(id)
native zp_donater_get_level(id)
public plugin_init()
{
register_plugin("Cheer", "2.5", "Para")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_concmd("consolecheer", "cmdconsolecheer", _, "Console Cheer", 0)
register_concmd("consolejeer", "cmdconsolejeer", _, "Console Jeer", 0)
register_clcmd("cheer", "CmdCheer")
//register_clcmd("cirno_cheer", "CmdCirnoCheer")
register_clcmd("say cheer", "CmdCheer")
register_clcmd("say_team cheer", "CmdCheer")
register_clcmd("say !cheer", "CmdCheer")
register_clcmd("say_team !cheer", "CmdCheer")
register_clcmd("say /cheer", "CmdCheer")
register_clcmd("say_team /cheer", "CmdCheer")
register_clcmd("say jeer", "CmdCheer")
register_clcmd("say_team jeer", "CmdCheer")
register_clcmd("say !jeer", "CmdCheer")
register_clcmd("say_team !jeer", "CmdCheer")
register_clcmd("say /jeer", "CmdCheer")
register_clcmd("say_team /jeer", "CmdCheer")
register_clcmd("say /laugh", "CmdCheer")
register_clcmd("say_team /laugh", "CmdCheer")
}
public plugin_precache()
{
for(new i = 0; i<sizeof cheerpath; i++)
precache_sound(cheerpath[i])
precache_sound(jeerpath)
//precache_sound(bakapath)
}
public client_putinserver(id)
{
set_task(5.0, "bindkey", id)
}
public bindkey(id)
{
client_cmd(id, "bind j cheer")
}
public cmdconsolecheer(id)
{
if(!(get_user_flags(id) & ADMIN_KICK))
return PLUGIN_HANDLED
ColorChat(0, GREEN, "^1伺服器控制台 ^4cheered!!!")
client_cmd(0, "spk %s", cheerpath[random_num(0, sizeof cheerpath - 1)])
return PLUGIN_HANDLED
}
public cmdconsolejeer(id)
{
if(!(get_user_flags(id) & ADMIN_KICK))
return PLUGIN_HANDLED
ColorChat(0, GREEN, "^1伺服器控制台 ^4jeered!!!")
client_cmd(0, "spk %s", jeerpath)
return PLUGIN_HANDLED
}
public event_round_start()
{
remove_task()
for(new i = 0; i<33; i++)
{
lastcheer[i] = 0.0
}
}
/*
public CmdCirnoCheer(id)
{
new name[33]
get_user_name(id, name, 32)
ColorChat(0, BLUE, "^3%s ^4baka!!!", name)
PlaySound(0, bakapath)
return PLUGIN_HANDLED
}
*/
public CmdCheer(id)
{
if(lastcheer[id] != 0.0 && lastcheer[id] + 3.0 > get_gametime())
{
client_print(id, print_chat, "不能笑得太頻繁!")
return PLUGIN_HANDLED
}
lastcheer[id] = get_gametime()
new name[33]
get_user_name(id, name, 32)
if(is_user_alive(id))
{
if(get_user_team(id) == 1)
{
if(zp_donater_get_level(id) > 0) ColorChat(0, RED, "^3%s ^4c^3h^4e^1e^4r^3e^4d^1!^4!^3!", name)
else ColorChat(0, RED, "^3%s ^4cheered!!!", name)
emit_sound(id, CHAN_AUTO, cheerpath[random_num(0, sizeof cheerpath - 1)], 0.30, ATTN_NORM, 0, PITCH_NORM)
}
else
{
if(zpm_models_get_selection(id) == 5007)
emit_sound(id, CHAN_AUTO, bakapath, 0.30, ATTN_NORM, 0, PITCH_NORM)
else emit_sound(id, CHAN_AUTO, cheerpath[random_num(0, sizeof cheerpath - 1)], 0.30, ATTN_NORM, 0, PITCH_NORM)
if(zp_donater_get_level(id) > 0) ColorChat(0, BLUE, "^3%s ^4c^3h^4e^1e^4r^3e^4d^1!^4!^3!", name)
ColorChat(0, BLUE, "^3%s ^4cheered!!!", name)
}
}
else
{
client_cmd(0, "spk %s", jeerpath)
switch(get_user_team(id))
{
case 1: ColorChat(0, RED, "^1*DEAD* ^3%s ^4jeered!!!", name)
case 2: ColorChat(0, BLUE, "^1*DEAD* ^3%s ^4jeered!!!", name)
default: ColorChat(0, GREY, "^1*SPEC* ^3%s ^4jeered!!!", name)
}
}
return PLUGIN_HANDLED
}
stock PlaySound(id, const sound[])
{
if (equal(sound[strlen(sound)-4], ".mp3")) client_cmd(id, "mp3 play ^"sound/%s^"", sound)
else client_cmd(id, "spk ^"%s^"", sound)
}