Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
0 Active | 55 Guests
Online:

LATEST FORUM THREADS

»
Mohaa maps on Cod2?
CoD2 MP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 MP Mapping
CoD 2 mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Play Music at start of map request
khopki30
General Member
Since: May 6, 2008
Posts: 46
Last: Jul 13, 2011
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Tuesday, Dec. 1, 2009 07:37 pm
I can handle ambient and triggered sounds, but how can I get a sound to play at the beginning (or end) of the map.

I have seen server mods that allow this but not specific maps.

Anyone know how to do this?
Share |
playername
Preferred Member
Since: Aug 24, 2006
Posts: 821
Last: Apr 15, 2011
[view latest posts]
Level 7
Forum Moderator
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Wednesday, Dec. 2, 2009 07:13 am
It depends exactly how you want to do it. Do you want it to play when the client connects so that they only hear it? If so, try something like this (Not tested).

Code:
main()
{
	thread onClientConnect();
}

onClientConnected()
{
	while(1)
	{
		level waittill("connected", client);
		client thread playMusic();
	}
}

playMusic()
{
	wait 1; // Wait a second to be sure they are ready.
	client playLocalSound("myMusic"); //Change to your sound alias
}
nullFew tips for coding.
1. Keep the script as short as possible.
2. Don't comment every line. Only comment portions where they may be needed to point something out.
3. Don't over complicate the script, keep it organized and easy to read.

These help you find simple errors and makes it easy to make changes.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 MP Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»