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
if sample==nil then sample={} end
sample.sayfuncs={}
-------------------------------------------
-- Fog function Hook --
-------------------------------------------
addhook("say","sample.sayfuncs.fog")
function sample.sayfuncs.fog(p,txt)
if (txt=="!fog_on") then
msg2(p,"Fog of war is now enabled!")
parse('sv_fow 1')
elseif (txt=="!fog_off") then
msg2(p,"Fog of war is now disabled!")
parse('sv_fow 0')
end
end
-------------------------------------------
-- Lan function Hook --
-------------------------------------------
addhook("say","sample.sayfuncs.lan")
function sample.sayfuncs.lan(p,txt)
if (txt=="!lan_on") then
msg2(p,"Your server is now in lan mode! Please note that your server wont be added to serverlist!")
parse('sv_lan 1')
elseif (txt=="!lan_off") then
msg2(p,"You had disabled lan mode! Your server will now be on the server list!")
parse('sv_lan 0')
parse('usgn_addserver')
end
end
-------------------------------------------
-- Friendlyfire function Hook --
-------------------------------------------
addhook("say","sample.sayfuncs.friendlyfire")
function sample.sayfuncs.friendlyfire(p,txt)
if (txt=="!ff_on") then
parse('sv_friendlyfire 1')
msg2(p,"You had enabled friendlyfire! You can now damage your own teammates!")
return 1
elseif (txt=="!ff_off") then
parse('sv_friendlyfire 0')
msg2(p,"You had disabled friendlyfire! You can not damage your own teammates!")
return 1
end
end
----------------------------------------------------------------
-- Autoteambalance function Hook --
----------------------------------------------------------------
addhook("say","sample.sayfuncs.autoteambalance")
function sample.sayfuncs.autoteambalance(p,txt)
if (txt=="!teambal_on") then
parse('mp_autoteambalance 1')
msg2(p,"You had enabled autoteam balance! Their will now be a balance of teams!")
return 1
elseif (txt=="!teambal_off") then
parse('mp_autoteambalance 0')
msg2(p,"You had disabled autoteam balance! Their will not be a balance of teams!")
return 1
end
end
----------------------------------------------------------------
-- USGN Registered Only function Hook --
----------------------------------------------------------------
addhook("say","sample.sayfuncs.usgnonly")
function sample.sayfuncs.usgnonly(p,txt)
if (txt=="!us_on") then
parse('sv_usgnonly 1')
msg2(p,"You had enabled Registered USGN Only! Only registered users will now have access to this server!")
return 1
elseif (txt=="!us_off") then
parse('sv_usgnonly 0')
msg2(p,"You had disabled Registered USGN Only! Only registered users will now have access to this server!")
return 1
end
end
-------------------------------------------
-- Clock function Hook --
-------------------------------------------
addhook("say","sample.sayfuncs.clock")
function sample.sayfuncs.clock(id,txt)
if (txt=="!clock_on") then
parse('hudtxt2 '..id..' 5 "'..os.date("©000128255Time: %I:%M %p")..'" 10 210')
parse('hudtxt2 '..id..' 6 "'..os.date("©000255128Date: %A, %d %b %Y")..'" 10 225')
msg("Clock Activated!")
elseif(txt=="!clock_off") then
msg("Clock Disabled!")
parse('hudtxt2 '..id..' 5 " " 10 210')
parse('hudtxt2 '..id..' 6 " " 10 225')
end
end