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

Members Online

»
0 Active | 8 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: Lightning sounds?
Arkadian
General Member
Since: Jan 27, 2008
Posts: 102
Last: Aug 23, 2009
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Thursday, Oct. 16, 2008 06:36 pm
Can anyone help me make a simple script to just play a lightning sound on my map? Just want it to play, stop for 120secounds and play again. which would be on a loop.

I already have the sound ready in my soundalias. Just need a script to run it.

Thanks,
Arkadian
Share |
codmp
General Member
Since: Feb 7, 2006
Posts: 905
Last: Aug 1, 2011
[view latest posts]
Level 7
Category: CoD4 Scripting
Posted: Thursday, Oct. 16, 2008 06:46 pm
Code:

main()
{
org = getent( "org", "targetname");

while(1)
{
       org  playsound("lightning")
       wait(120);
}
}



Something like that should work as long as you set up the sound files correctly. This script is based on just one script_origin.

edited on Oct. 16, 2008 02:51 pm by codmp
Share |
Arkadian
General Member
Since: Jan 27, 2008
Posts: 102
Last: Aug 23, 2009
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Thursday, Oct. 16, 2008 06:52 pm
ok codmp, thanks I'll try it
Share |
Arkadian
General Member
Since: Jan 27, 2008
Posts: 102
Last: Aug 23, 2009
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Friday, Oct. 17, 2008 01:19 pm
hmm doesnt seem to be working :(. Just get bad syntex error.

When you said "script_origin" did you mean placing a script origin box in the map then giving it targetname: "Org" Cause thats what I did. but just checking.


This is the code in my sound alias:
Code:
lightning,,customsounds/lightning.wav,0.99,0.99,,,,160,15000,voice,,mp_convoyassault_night,,,,,,,,


This is the code in my _fx.gsc:
Code:
 maps\mp\_fx::loopSound("lightning", (0.0,1.0,1392.0), 20);


and I have it uploaded in my zone file too as: rawfile,maps/mp/_lightning.gsc

Basicaly this is all the settings I have for the sound and script.
Share |
codmp
General Member
Since: Feb 7, 2006
Posts: 905
Last: Aug 1, 2011
[view latest posts]
Level 7
Category: CoD4 Scripting
Posted: Saturday, Oct. 18, 2008 07:54 pm
Sorry, I forgot a semi-colon in the code i posted above:

Code:

main()
{
org = getent( "org", "targetname");

while(1)
{
       org  playsound("lightning");
       wait(120);
}
}


This should work, or at least give no errors.
Share |
Arkadian
General Member
Since: Jan 27, 2008
Posts: 102
Last: Aug 23, 2009
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Sunday, Oct. 19, 2008 11:48 am
Hehe np codmp, I got it working eventually. The sounds are really good and happy the way its working [thumbs_up]
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

»