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
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
write = initArray(32)
function func_restart()
if v_restart==nil then v_restart=1 end
if v_restart==1 then v_restart=0 func_restart() end
if v_restart~=1 and v_restart~=nil and v_restart~=0 then msg("Dafuq. Hier isn FEHLA DRIN!") end
if v_restart==0 then v_restart=1 end
end
function func_event()
if v_event==nil then v_event=1 end
if v_event==1 then v_event=0 func_event() end
if v_event~=1 and v_event~=nil and v_event~=0 then msg("Dafuq. Hier isn FEHLA DRIN!") end
if v_event==0 then v_event=1 end
end
function tf_restart()
v_restart=0
msg("Abstimmung zu ende!")
for id=1,32 do
write[id]=0
end
msg("Abstimmung sagt:")
msg("Ja: "..vc_restart_j)
msg("Nein: "..vc_restart_n)
vc_restart_j = 0
vc_restart_n = 0
end
function tf_event()
v_event=0
msg("Abstimmung zu ende!")
for id=1,32 do
write[id]=0
end
msg("Abstimmung sagt:")
msg("Ja: "..vc_event_j)
msg("Nein: "..vc_event_n)
vc_event_j = 0
vc_event_n = 0
end
addhook("say","bbb")
function bbb(id,txt)
if txt=="!vote restart" then
msg("Admin hat Abstimmung gemacht!")
msg("Rundenneustart? Schreibe !ja oder !nein")
msg("Abstimmung isst anonym")
msg("Enthaltung: Nichts schreiben")
msg("Spieler haben 1 Minute Zeit")
func_restart()
timer(60000,"tf_restart")
elseif txt=="!vote event"
msg("Admin hat Abstimmung gemacht!")
msg("Event? Schreibe !ja oder !nein")
msg("Abstimmung isst anonym")
msg("Enthaltung: Nichts schreiben")
msg("Spieler haben 1 Minute Zeit")
func_restart()
timer(60000,"tf_event")
end
if txt=="!ja" then
if v_restart==1 then
if vc_restart_j==nil then vc_restart_j=0 end
if write[id]==0 then
vc_restart_j=vc_restart_j+1
write[id]=1
end
elseif v_event==1 then
if vc_event==nil then vc_event=0 end
if write[id]==0 then
vc_event_j=vc_event_j+1
write[id]=1
end
end
elseif txt=="!nein" then
if v_restart==1 then
if vc_restart_n==nil then vc_restart_n=0 end
if write[id]==0 then
vc_restart_n=vc_restart_n+1
write[id]=1
end
elseif v_event==1 then
if vc_event_n==nil then vc_event=0 end
if write[id]==0 then
vc_event_n=vc_event_n+1
write[id]=1
end
end
end
end