Page 2 of 2

Re: Unreal versus CoD2

Posted: May 28th, 2010, 8:03 pm
by Drofder2004
You are missing an equals sign.

A single '=' is for assigning a value (a = 3;)
You need double equals "==" meaning, equal to (a == 3)

Re: Unreal versus CoD2

Posted: May 28th, 2010, 11:02 pm
by <LT>YosemiteSam[NL]
I have this code now but still it doesn't recognize the timeleft number;

Code: Select all

thread time();

}
time()
{
if((level.starttime - getTime()) == 5000);
{
playsound ("5minutes");
}
It's probably real easy but I can't figure it out :x

Re: Unreal versus CoD2

Posted: May 29th, 2010, 5:38 pm
by Drofder2004
Going shop, will figure this out exactly when I get back...
(Will delete and repost when done)/

Re: Unreal versus CoD2

Posted: May 29th, 2010, 7:41 pm
by <LT>YosemiteSam[NL]
Ok, thx drof.
I started a new topic on this problem (so other people can search for it if they also need a script like this) so this one can be closed.

Re: Unreal versus CoD2

Posted: May 29th, 2010, 7:49 pm
by Drofder2004

Code: Select all

timePassed = (getTime() - level.startTime)/1000; 
//(getTime() is counted in milliseconds, level.starttime will normally be 0 or close...
// Dividing by 1000 returns the milliseconds to seconds.

timeRemaining = (level.timeLimit * 60) - timePassed;
// timelimit is measured in minutes, multiply by 60 to get seconds
// Once we have the timelimit in seconds, we subtract the timepassed, from the timelimit.

if(timeRemaining <= 300)
   //playsound


Use a default sounds first, to make sure the code is correct... then use your custom sound next...