Forum

> > CS2D > Scripts > Asking for a timer.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Asking for a timer.

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Asking for a timer.

Pablotez
User Off Offline

Zitieren
Hello guys, can someone help me to make a timer in my lua file?
If your answer is yes then listen what I want.

I want create a timer for a round restart that will start with 01:30:00, the round restart will be placed into my map to have a less work.

Thank you,
Caza.

alt Re: Asking for a timer.

Rainoth
Moderator Off Offline

Zitieren
1
timer(time,function,function parameter,repeat count)
What you need is:
1
timer(5400000,"parse","restart")
The code above will restart round after 5400000 milliseconds. If you want it to work when round is restarted before that (for example with a command or if it's not Team Deathmatch/Deathmatch/Construction mode and everyone dies or if all the objectives are completed) you'll have to free the timer every time that happens and set it up again (using startround hook will be needed).

alt Re: Asking for a timer.

Pablotez
User Off Offline

Zitieren
Thank you @user Rainoth: but I still have the same question, I want make a hudtxt up-right of cs2d window but I really have not idea to make it.

alt Re: Asking for a timer.

Ajmin
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
max=75 --Modify this to a particular number (calculated as minute default=75 minutes ) 
time_limit=0

addhook("ms100","_ms100")
function _ms100()
for i=1,32 do
parse('hudtxt2 '..i..' 1 "©000255000Auto-Refresh in: '..time_limit..'/'..max..' minutes" 10 425')
end
end



addhook("minute","_end")
function _end()
if time_limit<max then
time_limit=time_limit+1
end
if time_limit==max then
parse("restart 3")
time_limit=0
end
end

Hope i helped
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht