Unreal versus CoD2

Have questions about CoD2 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Unreal versus CoD2

Post by Drofder2004 » May 28th, 2010, 8:03 pm

You are missing an equals sign.

A single '=' is for assigning a value (a = 3;)
You need double equals "==" meaning, equal to (a == 3)
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Re: Unreal versus CoD2

Post by <LT>YosemiteSam[NL] » May 28th, 2010, 11:02 pm

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

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Unreal versus CoD2

Post by Drofder2004 » May 29th, 2010, 5:38 pm

Going shop, will figure this out exactly when I get back...
(Will delete and repost when done)/
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Re: Unreal versus CoD2

Post by <LT>YosemiteSam[NL] » May 29th, 2010, 7:41 pm

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.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Unreal versus CoD2

Post by Drofder2004 » May 29th, 2010, 7:49 pm

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...
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests