Forum

> > CS2D > Scripts > How to stop timers/reset LUA
Forums overviewCS2D overview Scripts overviewLog in to reply

English How to stop timers/reset LUA

2 replies
To the start Previous 1 Next To the start

old How to stop timers/reset LUA

Quattro
GAME BANNED Off Offline

Quote
Whenever my script starts executing, it does this:

1
2
3
4
5
6
timer(1000,"trgpistol")
timer(2000,"five")
timer(3000,"four")
timer(4000,"three")
timer(5000,"two")
timer(6000,"one")

and so on... The problem is, if I add big timer like 300000 and I restart round, it will still execute the function even if it's other round!

How to reset things so timers get canceled if round is restarted?

old Re: How to stop timers/reset LUA

Hajt
User Off Offline

Quote
freetimer()
- all timers will be canceled

1
2
3
4
5
6
timer(300000,"bigtimer")

addhook("endround","_endround")
function _endround()
	freetimer("bigtimer")
end

read more cs2d lua cmd freetimer
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview