Forum

> > CS2D > Scripts > flashlight for CT
Forums overviewCS2D overview Scripts overviewLog in to reply

English flashlight for CT

1 reply
To the start Previous 1 Next To the start

old flashlight for CT

save72
BANNED Off Offline

Quote
Need help again.
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
function initArray(m)
	local array = {}
	for i = 1, m 
	do array[i]=0
	end
		return array
end 


light=initArray(32)
light01=initArray(32)

addhook("say","lightz")
function lightz(p,t)

	if (t == "!light") then
		if (light01[p] == 1) then
			light01[p]=0
			freeimage(light[p])
		else 
			light01[p]=1
			light[p]=image("gfx/sprites/light.bmp",1,1,200+p)
			imageblend(light[p],1)
			imagecolor(light[p],200,200,100)
			imagealpha(light[p],0.7)
		end
		return 1
	end
end
This script should work only for CT.

old Re: flashlight for CT

EngiN33R
Moderator Off Offline

Quote
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
function initArray(m)
     local array = {}
     for i = 1, m 
     do array[i]=0
     end
          return array
end 


light=initArray(32)
light01=initArray(32)

addhook("say","lightz")
function lightz(p,t)

     if (t == "!light" and player(p,"team")==2) then
          if (light01[p] == 1) then
               light01[p]=0
               freeimage(light[p])
          else 
               light01[p]=1
               light[p]=image("gfx/sprites/light.bmp",1,1,200+p)
               imageblend(light[p],1)
               imagecolor(light[p],200,200,100)
               imagealpha(light[p],0.7)
          end
          return 1
     end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview