The Dink Network

Reply to Re: Timer

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
September 26th 2008, 10:16 AM
dinkdead.gif
You'll need a global variable, so in main.c add:
make_global_int("&yourname", 0);

Call it what you like. When you start the timer, instead of just doing spawn("timer"); do this
&yourname = spawn("timer");

Then to stop it, add one of these lines anywhere in your script:
run_script_by_number(&yourname, "stoptheclock");
will kill the timer but leave the (stopped) time drawn to the screen.
run_script_by_number(&yourname, "kill");
will stop the timer and kill the displayed time.

Nice to know someone's using it

Edit: I was writing this at the same time as Metatarasal
His way is probably what you meant, I wasn't thinking. My way will just kill the timer off.

I mean, use my way if you just want to stop and get rid of the timer.
Use Metatarasal's way if you want something to happen when the timer stops, for example if you have to hit this thing before the time runs out. Put what you want to happen in the right place in timer.c.