, Also it will be cool if my map have others players skins ..... but i am fresh on Scripts. Forum
Scripts
Hello I need Flash light script
Hello I need Flash light script
8 replies
1

, Also it will be cool if my map have others players skins ..... but i am fresh on Scripts. Download it and install it. Then open the flashlight.lua file inside "sys/lua" with notepad or some txt editor, delete what is writed there and paste this :
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("spawn","lightz")
function lightz(id)
	local light=image("gfx/sprites/light.bmp",1,1,id+200)
	imageblend(light,1)
	imagecolor(light,255,255,255)
	imagealpha(light,0.5)
end
And about the player skins i can do it but it will cover some things (knife,etc) and you need to give we what skins you want.
Its on the older version read in the coments and it dont working for me , also i been maked your code into a .lua but how to active it it will be coolest if light will be actived by f2 or f3
edited 1×, last 17.06.13 05:54:25 pm
It works
Just open flashlight.lu, delete everything and paste this :
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
addhook("serveraction","lightzas")
function lightzas(id,action)
	if action == 2
		local light=image("gfx/sprites/light.bmp",1,1,id+200)
		imageblend(light,1)
		imagecolor(light,255,255,255)
		imagealpha(light,0.5)
	end
end
Please verify if is installed correct
Cs2d already haves a flashlight
_Yank: What did you expected on a forum filled with tons of idiots and scumbags? Admin/mod comment
§3.1 - No posts which offend/provoke/insult (flame)
Sneaky has writtenArghh , press F and boom a flashlight .....
Cs2d already haves a flashlight

Cs2d already haves a flashlight

Yes CS2D have. but only the flare will turned on when you press "F". if you tired to use it with lighting then it will crash your CS2D
This is the code. It's hooked to flashlight hook(Press <Flashlight Key>(default F))
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
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
FlashLightState={}
for i=1,32 do FlashLightState[i]=0 end
HasStartround=false	-- Set to true if your server would start round more than 1 times
addhook("flashlight","Methane")
function Methane(id,state)
	if state==1 then
		FlashLightState[id]=image("gfx/sprites/light.bmp<a>",1,0,id+100)
	else
		freeimage(FlashLightState[id])
		FlashLightState[id]=0
	end
end
addhook("join","Legacy")
function Legacy(id)
	FlashLightState[id]=0
end
addhook("leave","Welcome")
function Welcome(id)
	if FlashLightState[id]>0 then
		freeimage(FlashLightState[id])
		FlashLightState[id]=0
	end
end
if HasStartround then
	addhook("startround","StartIt")
	function StartIt()
		for _, id in pairs(player(0,"table")) do
			if FlashLightState[id]>0 then
				FlashLightState[id]=image("gfx/sprites/light.bmp<a>",1,0,id+100)
			end
		end
	end
end
1

Offline