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
snow_id = 75
snow_img = "gfx/ball.png"
snow_pl = {}
for id = 1, 32 do
	snow_pl[id] = {}
end
for id = 1, 32 do
	for projID = 0, 49 do
		snow_pl[id][projID] = -1
	end
end
addhook("always","snow_alw")
function snow_alw()
	for _, id in ipairs(player(0,"tableliving")) do
		for projID = 0, 49 do
			if projectile(projID,id,"exists") then
				if projectile(projID,id,"type")==snow_id then
					local x, y, ang, dist = projectile(projID,id,"x"), projectile(projID,id,"y"), projectile(projID,id,"dir"), projectile(projID,id,"flydist")
					if dist > 9 then
						if snow_pl[id][projID] < 0 then
							snow_pl[id][projID] = image(snow_img,x,y,1)
						else
							imagepos(snow_pl[id][projID],x,y,ang)
						end
					elseif snow_pl[id][projID] >= 0 then
						freeimage(snow_pl[id][projID])
						snow_pl[id][projID] = -1
					end
				end
			elseif snow_pl[id][projID] >= 0 then
				freeimage(snow_pl[id][projID])
				snow_pl[id][projID] = -1
			end
		end
	end
end