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
function stat_projectile(id,w,zx,zy)
	if (w == 52) then
		for m, p in pairs(player(0,"table")) do
			if (player(id,"team") ~= player(p,"team")) then
				local px = player(p,"x")
				local py = player(p,"y")
				local fx = zx
				local fy = zy
				if (pointInRect(zx,zy,px - 336,py - 256,640,480) == true) then
					local rot = math.atan2(fy - py, fx - px)
					local hit = 1
					while distance(fx,fy,px,py) > 4 do
						fx = fx - math.cos(rot) * 3
						fy = fy - math.sin(rot) * 3
						if (tile(math.ceil(fx / 32) - 1,math.ceil(fy / 32) - 1,"wall")) then
							hit = 0
							--break
						end
					end
					if (hit > 0) then
						IncreaseUserValue(id,"SuccessFlashbang",1)
					end
				end
			end
		end
	end
end