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
addhook("serveraction", "_serveraction")
wallhack = {}
for i = 1, game("sv_maxplayers") do wallhack[i] = 0 end
function _serveraction(p, n)
	if n == 1 then
		if wallhack[p]==1 then
			wallhack[p]=0
		elseif wallhack[p]==0 then
			wallhack[p]=1
			wallhackfunction(p)
		end
	end
end
function wallhackfunction(i)
	i=tonumber(i)
	if wallhack[i] == 1 then
		timer(1,"wallhackfunction",i)
		local rot = player(i,[[rot]])
		if rot < -90 then rot = rot + 360 end
		local angle = math.rad(math.abs( rot + 90 )) - math.pi
		local x = player(i,[[x]]) + math.cos(angle) * 6
		local y = player(i,[[y]]) + math.sin(angle) * 6
		if x > 0 and y > 0 and x < map([[xsize]]) * 32 and y < map([[ysize]]) * 32 then
			parse([[setpos ]]..i..[[ ]]..x..[[ ]]..y)
		end
	end
end