-
Notifications
You must be signed in to change notification settings - Fork 1
/
td_shop_norecoil.sma
77 lines (61 loc) · 1.67 KB
/
td_shop_norecoil.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
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <td>
#include <fakemeta>
#include <colorchat>
#define PLUGIN "TD: Shop | No recoil"
#define VERSION "1.0"
#define AUTHOR "tomcionek15 & grs4"
new iItem;
new g_iWaveNums[33]
public plugin_init() {
new id = register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_PlayerPreThink, "PreThink");
register_forward(FM_UpdateClientData, "UpdateClientData", 1)
iItem = td_shop_register_item("No recoil", "Brak rozrzutu przez 2 fale", 250, 0, id)
}
public td_reset_player_info(iPlayer)
g_iWaveNums[iPlayer] = 0;
public client_disconnected(iPlayer)
g_iWaveNums[iPlayer] = 0;
public td_shop_item_selected(id, itemid) {
if(iItem == itemid)
{
g_iWaveNums[id] += 2;
ColorChat(id, GREEN, "[TD]^x01 Brak rozrzutu bedzie aktywny %d fale!", g_iWaveNums[id]);
SetOff(id + 54222);
}
return PLUGIN_CONTINUE;
}
public td_wave_ended(iEndedWave)
{
for(new i = 1; i < 33 ; i++) {
if(g_iWaveNums[i] > 0) {
g_iWaveNums[i]--;
}
}
}
public SetOff(id)
{
id -= 54222;
if(g_iWaveNums[id] == 0)
{
set_hudmessage(200, 255, 0, 0.60, 0.69, 0, 0.1, 4.1, 0.1, 0.1, -1)
show_hudmessage(id,"Brak rozrzutu wylaczony!")
ColorChat(id, GREEN, "[TD]^x01 Brak rozrzutu wylaczony!");
return;
}
set_hudmessage(200, 255, 0, 0.60, 0.69, 1, 0.1, 1.1, 0.1, 0.1, -1)
show_hudmessage(id, "Brak rozrzutu: %d %s left", g_iWaveNums[id], g_iWaveNums[id] == 1 ? "fala" : "fale")
set_task(1.0, "SetOff", id + 54222);
}
public PreThink(id) {
if(g_iWaveNums[id]) {
set_pev(id, pev_punchangle, {0.0,0.0,0.0})
}
}
public UpdateClientData(id, sw, cd_handle) {
if(g_iWaveNums[id]) {
set_cd(cd_handle, CD_PunchAngle, {0.0,0.0,0.0})
}
}