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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
Admins={
	--[[ Add admins here. Example:
	53360,
	98519
	Separate by comma.
	]]
	123734
}
DefaultBuildingLimit={
	barricade=1000,
	["barbed wire"]=1000,
	["wall i"]=1000,
	["wall ii"]=1000,
	["wall iii"]=1000,
	["gate field"]=5,
	dispenser=1,
	turret=1,
	supply=1,
	["teleporter entrance"]=1,
	["teleporter exit"]=1
}
BuildingPrice={
	300,
	500,
	1000,
	2000,
	3000,
	1500,
	5000,
	5000,
	5000,
	0,
	0,
	0,
	3000,
	3000
}
	
setmetatable(DefaultBuildingLimit,{
	__call=function(_,t)
		for n,v in pairs(_) do
			if t then
				parse("mp_building_limit \""..n.."\" "..v)
			else
				parse("mp_building_limit \""..n.."\" 2147483647")	-- Max value. building limit is using signed 4byte(max 2147483647)
			end
		end
	end,
})
CMD={}
COMMAND=CMD
BadWordList={}
reset_score = 0
badwords = 0
show_damage = 0
unlimited_build = 0
fast_build = 0
no_reload = 0
wallhack = 0
godmode = 0
explosive_snowballs = 0
HitList={}
god={}
for i=1,32 do HitList[i]=0 god[i]=false end
function ValAval(t,v)
	for a,u in pairs(t) do
		if u==v then
			return a
		end
	end
end
function ToBool(v)
	if v==0 then return false end
	return not not v
end
function OnOff(v)
	local boolean=ToBool(v)
	if boolean==false then return "Off"
	else return "On" end
end
function AuahDark_projectile(id,w,x,y)
	if w==75 then
		parse("explosion "..x.." "..y.." 75 60 "..id)
	end
end
function AuahDark_attack(id)
	parse("equip "..id.." "..player(id,"weapontype"))
end
function AuahDark_buildattempt(id,type,x,y,mode)
	if player(id,"money")>=BuildingPrice[type] then
		parse("spawnobject "..type.." "..x.." "..y.." "..player(id,"rot").." "..mode.." "..player(id,"team").." "..id.."; setmoney "..id.." "..player(id,"money")-BuildingPrice)
		return 1
	end
end
function CMD.resetscore(id)
	if _G.resetscore==1 then
		parse("setscore "..id.." 0")
		parse("setdeaths "..id.." 0")
		msg("\169000255000"..player(id,"name").." used resetscore")
	end
end
function CMD.god(id)
	if godmode==1 then
		if god[id]==false then
			god[id]=true
			msg("\169000255000Godmode enabled")
		else
			god[id]=false
			msg("\169255000000Godmode disabled")
		end
	end
end
addhook("join","AuahDark_join")
function AuahDark_join(id)
	HitList[id]=0
	god[id]=false
end
addhook("hit","AuahDark_hit")
function AuahDark_hit(id,pl,w,hp)
	if god[id] then return 1 end
	if w==75 and explosive_snowballs==1 then
		return 1
	end
	if show_damage==1 then
		if HitList[pl]>0 then
			freetimerEx(HitList[pl])
		end
		HitList[pl]=timerEx(500,loadstring("parse(\"hudtxt2 "..pl.." 49\") HitList["..pl.."]=0"),1)
		parse("hudtxt2 "..pl.." 49 \"\169255255255-"..hp.." HP\" 320 230 1")
	end
end
addhook("say","Auahark_say")
function Auahark_say(id,txt)
	if badwords==1 then
		for n,v in pairs(BadWordList) do
			if txt:find(v) then
				parse("kick "..id)
				return 1
			end
		end
	end
	if txt:sub(1,1)=="!" then
		local Params={}
		for w in string.gmatch(txt,"%S+") do
			table.insert(Params,tonumber(w) or w)
		end
		for n,v in pairs(CMD) do
			if n==Params[1]:sub(2) then
				table.remove(Params,1)
				v(id,unpack(Params))
				return 1
			end
		end
	end
end
addhook("serveraction","AuahDark_serveraction")
function AuahDark_serveraction(id,a)
	if a==1 then
		if ValAval(Admins,player(id,"usgn")) then
			menu(id,"Activate A Script,Reset Score|"..OnOff(reset_score)..",Fast Build|"..OnOff(fast_build)..",Unlimited Build|"..OnOff(unlimited_build)..",No Reload|"..OnOff(no_reload)..",Badwords|"..OnOff(badwords)..",Show Damage|"..OnOff(show_damage)..",Wallhack|"..OnOff(wallhack)..",Explosive Snowballs|"..OnOff(explosive_snowballs)..",God Mode|"..OnOff(godmode))
		end
	elseif a==3 and wallhack==1 then
		local rot = player(id,"rot")
		if rot<(-90) then rot=rot+360 end
		local angle = math.rad(math.abs(rot+90)) - math.pi
		local x = player(id,"x") + math.cos(angle) * --[[Speed:]]10
		local y = player(id,"y") + math.sin(angle) * --[[Speed:]]10
		if x>0 and y>0 and x<map("xsize")*32 and y<map("ysize")*32 then
			parse("setpos "..id.." "..math.floor(x).." "..math.floor(y))
		end
	end
end
addhook("menu","AuahDark_menu")
function AuahDark_menu(id,men,sel)
	if men=="Activate A Script" then
		if sel>0 then
			if sel==1 then
				if reset_score==0 then
					reset_score=1
					msg("\169000255000Resetscore enabled by "..player(id,"name"))
				else
					reset_score=0
					msg("\169255000000Resetscore disabled by "..player(id,"name"))
				end
			elseif sel==2 then
				if fast_build==0 then
					fast_build=1
					unlimited_build=1
					DefaultBuildingLimit(false)
					addhook("buildattempt","AuahDark_buildattempt")
					msg("\169000255000Fast build and unlimted build enabled by "..player(id,"name"))
				else
					fast_build=0
					unlimited_build=0
					DefaultBuildingLimit(true)
					freehook("buildattempt","AuahDark_buildattempt")
					msg("\169255000000Fast build and unlimted build disabled by "..player(id,"name"))
				end
			elseif sel==3 then
				if unlimited_build==0 then
					unlimited_build=1
					DefaultBuildingLimit(false)
					msg("\169000255000Unlimted build enabled by "..player(id,"name"))
				else
					unlimited_build=0
					fast_build=0
					DefaultBuildingLimit(true)
					freehook("buildattempt","AuahDark_buildattempt")
					msg("\169255000000Fast build and unlimited build disabled by "..player(id,"name"))
				end
			elseif sel==4 then
				if no_reload==0 then
					no_reload=1
					addhook("attack","AuahDark_attack")
					msg("\169000255000No reload and unlimited ammo enabled by "..player(id,"name"))
				else
					no_reload=0
					freehook("attack","AuahDark_attack")
					msg("\169255000000No reload and unlimited ammo disabled by "..player(id,"name"))
				end
			elseif sel==5 then
				if badwords==0 then
					badwords=1
					msg("\169000255000Anti-badwords enabled by "..player(id,"name"))
				else
					badwords=0
					msg("\169255000000Anti-badwords disabled by "..player(id,"name"))
				end
			elseif sel==6 then
				if show_damage==0 then
					show_damage=1
					msg("\169000255000Show damage enabled by "..player(id,"name"))
				else
					show_damage=0
					msg("\169255000000Show damage disabled by "..player(id,"name"))
				end
			elseif sel==7 then
				if wallhack==0 then
					wallhack=1
					msg("\169000255000Wallhack enabled by "..player(id,"name"))
				else
					wallhack=0
					msg("\169255000000Wallhack disabled by "..player(id,"name"))
				end
			elseif sel==8 then
				if explosive_snowballs==0 then
					explosive_snowballs=1
					addhook("projectile","AuahDark_projectile")
					msg("\169000255000Explosive snowballs enabled by "..player(id,"name"))
				else
					explosive_snowballs=0
					freehook("projectile","AuahDark_projectile")
					msg("\169255000000Explosive snowballs disabled by "..player(id,"name"))
				end
			elseif sel==9 then
				if godmode==0 then
					godmode=1
					msg("\169000255000God mode enabled by "..player(id,"name"))
				else
					godmode=0
					msg("\169255000000God mode disabled by "..player(id,"name"))
				end
			end
			menu(id,"Activate A Script,Reset Score|"..OnOff(reset_score)..",Fast Build|"..OnOff(fast_build)..",Unlimited Build|"..OnOff(unlimited_build)..",No Reload|"..OnOff(no_reload)..",Badwords|"..OnOff(badwords)..",Show Damage|"..OnOff(show_damage)..",Wallhack|"..OnOff(wallhack)..",Explosive Snowballs|"..OnOff(explosive_snowballs)..",God Mode|"..OnOff(godmode))
		end
	end
end
Required