Forum

> > CS2D > Scripts > Flash script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Flash script

10 replies
To the start Previous 1 Next To the start

old Flash script

Marcell
Super User Off Offline

Quote
Hello,Anyone can help me??
i want to create a flash script for stroboscope..

so the script flash every 1-2 seconds the screen
or random second..
Possible is it?

old Re: Flash script

EngiN33R
Moderator Off Offline

Quote
1
2
3
4
5
6
7
function autoflash_begin(id)
	timer(2000,"parse","flashplayer "..id,0)
end

function autoflash_end(id)
	freetimer("parse","flashplayer "..id)
end

old Re: Flash script

Marcell
Super User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("serveraction" ,"sact")
function sact(id, act)
 if(act==1) then
  menu(id, "Smoke Machine, Start/Stop Smoker, Start Stroboscope")
end
end

addhook("menu", "menus")
function menus(id, tit, sel)
  if(tit=="Smoke Machine") then
       if(sel==1) then
parse("trigger 25"); 
       if(sel==2) then
THE CODE

i want that if i select from menu start stroboscope..
the flash start every seconds

old Re: Flash script

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
30
31
32
33
34
flashing = {}

function autoflash_begin(id)
	flashing[id] = true
	timer(1000,"parse","flashplayer "..id.." 10",0)
end

function autoflash_end(id)
	flashing[id] = false
	freetimer("parse","flashplayer "..id.." 10")
end

addhook("serveraction" ,"sact")
function sact(id, act)
	if(act==1) then
		menu(id, "Smoke Machine, Start/Stop Smoker, Toggle Stroboscope")
	end
end

addhook("menu", "menus")
function menus(id, tit, sel)
	if(tit=="Smoke Machine") then
		if(sel==1) then
			parse("trigger 25");
		end
		if(sel==2) then
			if not flashing[id] then
				autoflash_begin(id)
			else
				autoflash_end(id)
			end
		end
	end
end
edited 2×, last 26.02.12 04:30:16 pm

old Re: Flash script

Marcell
Super User Off Offline

Quote
yes but its flash all map, custom area?
edited 1×, last 26.02.12 05:29:21 pm

Admin/mod comment

Yes, don't put needless replies.

old Re: Flash script

MikuAuahDark
User Off Offline

Quote
@user EngiN33R: you should use cs2d cmd flashposition
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
flashing = {}

function autoflash_begin(id)
	flashing[id] = true
	timer(1000,"parse","flashposition yourxposition youryposition 10",0)		-- change yourxposition and youryposition
end

function autoflash_end(id)
     flashing[id] = false
     freetimer("parse","flashposition yourxposition youryposition 10",0)
end

addhook("serveraction" ,"sact")
function sact(id, act)
     if(act==1) then
          menu(id, "Smoke Machine, Start/Stop Smoker, Toggle Stroboscope")
     end
end

addhook("menu", "menus")
function menus(id, tit, sel)
     if(tit=="Smoke Machine") then
          if(sel==1) then
               parse("trigger 25");
          end
          if(sel==2) then
               if not flashing[id] then
                    autoflash_begin(id)
               else
                    autoflash_end(id)
               end
          end
     end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview