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

Members Online

»
0 Active | 7 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

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 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Help !!
jimbojetset
General Member
Since: Jul 6, 2008
Posts: 1
Last: Jul 6, 2008
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Sunday, Jul. 6, 2008 02:04 pm
I'm trying to create what seems like a very simple MP MOD that will play a sound in response to setting a dvar/cvar.... I've tried google and looked at other MODs but I can't get anything to work...

for example.. if I typed in at the console

/rcon set playSound 1

then the sound (mp3) would play once so everyone in-game heard it.

is a MOD of this sort possible...

edited on Jul. 6, 2008 10:05 am by jimbojetset
Share |
exsolvedh3
General Member
Since: Jan 23, 2008
Posts: 18
Last: Jul 9, 2008
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Tuesday, Jul. 8, 2008 05:45 am
Yup, its possible, would be something like

Code:

checkDvars()
{
while(1)
{
if(GetDvar("play_sound") == "1")
{
players = level.players;
for(i=0; i<players.size; i++)
{
player = players[i];
player PlaySoundToPlayer( "some_song", self );
setDvar("play_sound", "0")
}
}
}
}


Hmm, I hope that helps.... if you're still confused ask me over at www.infinitytutorials.com, as i'm not here very often.

Good Luck :D
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

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

»