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

Members Online

»
0 Active | 6 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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Sound Problem!!
Marsh999
General Member
Since: Aug 7, 2008
Posts: 8
Last: Aug 27, 2008
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Monday, Aug. 25, 2008 07:11 pm
Hi All

I have put a playable sound into my map and it works fine. The only problem is that it runs automaticly and i want a player to be able to activate it and I dont want it to keep looping either:(

Has anyone got a script to help me out with this problem???

Quote:
main()
{
thread alert_sound();

}

alert_sound()
{
alerts = getentarray ("radio", "targetname");
while (1)
{

{
for (i=1;i alerts[0] playsound("radio");

alerts[0] playsound("radio");

wait (180);

self thread alert_sound();

return;
}
}
}


Also another problem I am having is that I have a working elevator with a sound but when I activate the elevator the sound from the radio goes to the trigger of the elevator :(



edited on Aug. 25, 2008 03:12 pm by Marsh999
Share |
kalieck
General Member
Since: Aug 9, 2006
Posts: 161
Last: Feb 14, 2009
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Tuesday, Aug. 26, 2008 10:57 pm
1. Try this:
Code:
main()
{
thread alert_sound();

}

alert_sound()
{
alerts = getentarray ("radio", "targetname");
trigsound = getent("trigger", "targetname"); // make a trigger called trigsound
while (1)
{
alerts waittill ("trigsound");
{
for (i=1;i
alerts[0] playsound("radio");

alerts[0] playsound("radio");

wait (180);

self thread alert_sound();

return;
}
}
}


2.
show us the code of the elevator pls
Share |
Marsh999
General Member
Since: Aug 7, 2008
Posts: 8
Last: Aug 27, 2008
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Wednesday, Aug. 27, 2008 11:28 am
This is the Elevator script im using :)

Quote:
main() {
level.elevatorDown = true; // elevator starts at bottom: true/false
level.elevatorMoving = false; // elevator is not currently moving
thread elevator_start();
}

elevator_start() {
elevator = getentarray ("elevatorswitch","targetname");
if ( isdefined(elevator) )
for (i = 0; i < elevator.size; i++)
elevator thread elevator_think();
}

elevator_think() {
while (1) {
self waittill ("trigger");
if (!level.elevatorMoving)
thread elevator_move();
}
}

elevator_move() {
elevatormodel = getent ("elevatormodel", "targetname");
elevator = getent ("elevator", "targetname");
level.elevatorMoving = true;
speed = 8.8;
height = 696;
wait (1);
if (level.elevatorDown) { // moves to top
elevator playsound ("elevator"); // sound definition for soundaliases.csv
wait (1); // wait a second to hear the motor start and then start the movement of the lift - feels more realistic
elevatormodel moveZ (height, speed);
elevatormodel waittill ("movedone");
level.elevatorDown = false;
}
else { // moves to bottom
elevator playsound ("elevator"); // sound definition for soundaliases.csv
wait (1); // wait a second to hear the motor start and then start the movement of the lift - feels more realistic
elevatormodel moveZ (height - (height * 2), speed);
elevatormodel waittill ("movedone");
level.elevatorDown = true;
}
level.elevatorMoving = false;
}


thx for replying
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»