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
--------------
-- SETTINGS --
--------------
local imagePath = 'gfx/cs2d.bmp'
local drawInFog = 0
local rotation = 0
local rotationSpeed = 1
local frequency = 1000 -- frequency of reducing and enlarging in milliseconds
local resizeUpTo = 0.7
local imageMode = 100 --[[
	Mode 100: draw under this player (id+100)
	Mode 200: draw over this player (id+200)
	Mode 132: draw over this player and over entities (id+132) ]]
--------------
-- ENGINE --
--------------
gajos_coolImage = {}
local cl = gajos_coolImage
cl.imageid = false
cl.var_cool = false
addhook('ms100', 'gajos_coolImage.variableCapture')
function cl.variableCapture()
	for _, id in pairs(player(0, 'table')) do
		if cool then
			if cool[id] and not cl.var_cool then
				cl.var_cool = true
				cl.drawImage(id)
			elseif not cool[id] and cl.var_cool then
				cl.var_cool = false
				cl.removeImage(id)
			end
		end
	end
end
function cl.drawImage(id)
	cl.imageid = image(imagePath, rotation, drawInFog, id + imageMode)
	tween_rotateconstantly(cl.imageid, rotationSpeed)
end
function cl.removeImage()
	if cl.imageid then
		freeimage(cl.imageid)
		cl.imageid = false
	end
end
function cl.rotateImage(mode)
	local mode = tonumber(mode)
	if cl.imageid then
		if mode == 1 then
			mode = 2
			tween_scale(cl.imageid, frequency, resizeUpTo, resizeUpTo)
		elseif mode == 2 then
			mode = 1
			tween_scale(cl.imageid, frequency, 1, 1)
		end
	end
	timer(frequency, 'gajos_coolImage.rotateImage', mode, 1)
end
cl.rotateImage(1)