-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmd_pigmode.cfg
56 lines (47 loc) · 1.22 KB
/
cmd_pigmode.cfg
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
// pig mode - by star
pigs = ""
pigvar = 0
getpigs = [
allcn = $listclients
loop i (listlen $allcn) [
clnt = (at $allcn $i)
if (=s (getteam $clnt) $pigteam) [
if (!= (isspectator $clnt) 1) [
pigs = (concat $pigs $clnt)
]
]
]
]
pigmode = [
pigteam = $arg2
if (= $arg3 1) [
say (format "^f5PIGmode ^f0enabled! ^f7Please pick a map!")
pigvar = 1
getpigs
sleep 1000 [loop k (listlen @pigs)[ suicide (at @@pigs $k)]]
][
say (format "^f5PIGmode ^f3disabled! ^f7Thank you for picking a map! - A service presented to you by vaQ'clan, your favourite partner in clanwars! (c)")
pigvar = 0
pigs = ""
]
]
registercommand "pigmode" pigmode 3 "wb" "pigmode <team> <1|0> - Start|stop pigmode."
checkpig = [
if (= $pigvar 1)[
loop j (listlen $pigs) [
if (= (at $pigs $j) @arg1) [
sleep 1000 [suicide @@arg1
echo (format "%1 is suicided" @@arg1)]
]
]
]
]
// Doesn't work properly. Causes but one suicide on spawn when map is loaded.
endpig = [
if (= $pigvar 1)[
pigvar = 0
say (format "^f5PIGmode ^f3disabled! ^f7Thank you for picking a map! - A service presented to you by vaQ'clan, your favourite partner in clanwars! (c)")
]
]
addhandler "onspawn" checkpig
addhandler "onmapstart" endpig