Rotating weapon help
Moderator: Core Staff
-
- Core Staff
- Posts: 2155
- Joined: December 7th, 2004, 2:07 am
- Location: Netherlands
- Contact:
Re: Rotating weapon help
ok thx.
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Rotating weapon help
It's done simmilarly there, so that didn't get me anywhere. Have tried simply getting all the players on the server and printing a message to all of them. Didn't work. :S
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
Re: Rotating weapon help
here's the code i wrote. it's cod1, but should be working for cod2.
i advide using custom variables in order not to have troubles with stock ones. however, probably in it i'm mistaken.
but i'm sure i had some troubles with changing timelimit by stock variables being used.
Code: Select all
time()
{
if (!isDefined(level.timelimit_custom))
{
level.timelimit_custom = getCvarFloat("scr_dm_timelimit");
level.realtime_custom = getTime();
}
while (timeleft() > 300)
wait 1;
iPrintLnBold("5 minutes left");
wait 1;
level.timelimit_custom = getCvarFloat("scr_dm_timelimit");
//thread time(); //unlock this string if you want to let the script print it again if some admin changed (extended) timelimit after the printing
}
timeLeft()
{
if (level.timelimit != getCvarFloat("scr_dm_timelimit"))
{
level.timelimit_custom = getCvarFloat("scr_dm_timelimit");
level.realtime_custom = getTime();
}
realtime = (getTime()-level.realtime_custom)/1000;
timeleft = getCvarFloat("scr_dm_timelimit")*60 - realtime;
if (timeleft < 300) timeleft = 1000; //if timelimit is less than 5 minutes, do not let the script print anything to players
return timeleft;
}
but i'm sure i had some troubles with changing timelimit by stock variables being used.
Re: Rotating weapon help
Try replacing this:
with this:
Code: Select all
players[i] playsound("jump_pad");
Code: Select all
players[i] playLocalSound("jump_pad");
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
-
- Core Staff
- Posts: 2155
- Joined: December 7th, 2004, 2:07 am
- Location: Netherlands
- Contact:
Re: Rotating weapon help
Thx alot magazor ! It works fine, you forgot the word custom in one of the lines but i forgive you
This is the final code which plays the announcers voice "5minutes remaining" of UT99.
This is the final code which plays the announcers voice "5minutes remaining" of UT99.
Code: Select all
main()
{
thread time();
}
time()
{
if (!isDefined(level.timelimit_custom))
{
level.timelimit_custom = getCvarFloat("scr_dm_timelimit");
level.realtime_custom = getTime();
}
while (timeleft() > 300)
wait 1;
player = getent("player","classname");
player playsound("fiveminutes");
wait 1;
level.timelimit_custom = getCvarFloat("scr_dm_timelimit");
//thread time(); //unlock this string if you want to let the script print it again if some admin changed (extended) timelimit after the printing
}
timeLeft()
{
if (level.timelimit_custom != getCvarFloat("scr_dm_timelimit"))
{
level.timelimit_custom = getCvarFloat("scr_dm_timelimit");
level.realtime_custom = getTime();
}
realtime = (getTime()-level.realtime_custom)/1000;
timeleft = getCvarFloat("scr_dm_timelimit")*60 - realtime;
if (timeleft < 300) timeleft = 1000; //if timelimit is less than 5 minutes, do not let the script print anything to players
return timeleft;
}
Re: Rotating weapon help
The sound will sound a lot better if you replace playSound with playLocalSound.
The reason I say this is because it will play the sound out loud from your player origin.
So say you have multiple players in the server, they will all be outputting this sound into the world, which will sound awkward.
Using playLocalSound will only pass the sound through the players' speakers only, avoiding the echo/repeating sound.
The reason I say this is because it will play the sound out loud from your player origin.
So say you have multiple players in the server, they will all be outputting this sound into the world, which will sound awkward.
Using playLocalSound will only pass the sound through the players' speakers only, avoiding the echo/repeating sound.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Rotating weapon help
As said, you need to use local sound.
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
-
- Core Staff
- Posts: 2155
- Joined: December 7th, 2004, 2:07 am
- Location: Netherlands
- Contact:
Re: Rotating weapon help
Aha ok. But if I put "localsound" into the csv file that would be alright aswell....right ?
Re: Rotating weapon help
Just have it set as auto, CoD2 will do the rest in game.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet
-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]
Re: Rotating weapon help
Code: Select all
player = getent("player","classname")
Who is online
Users browsing this forum: No registered users and 4 guests