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

Members Online

»
0 Active | 52 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP 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 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: player oriented trigger
viraj_mantri
General Member
Since: Nov 15, 2006
Posts: 66
Last: May 16, 2007
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Apr. 21, 2007 06:15 am
hi,is it possible to use trigger in cod2 mp level which r player or team oriented ,so tat if a trigger is set for axis players and if allies player comes in contact with that trigger,it wont get activate but will work only when axis player comes in contact.is it possible to do so using script or n e other method pls help me solve this ??

edited on Apr. 21, 2007 02:16 am by viraj_mantri
Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Apr. 21, 2007 06:56 am
You could do something like this:

Code:
	while (1)
{
	trig waittill ("trigger",other);
	if ((isplayer (other)) && (other.pers["team"] == "allies"))
	break;
}


All you need to change 'allies' or 'axis' to the team you want to trigger the trigger.
Share |
viraj_mantri
General Member
Since: Nov 15, 2006
Posts: 66
Last: May 16, 2007
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Apr. 21, 2007 10:22 am
thanx buddy,it work for events but when i try to implement for sound,where sound will b the event and it will b set on (played)via trigger with the same axis & allies concepts,it give me error that uninitialise variable 'other'.
i m posting u my code for the above idea

sound5()
{
trig = getent ("sound5_trigger","targetname");
while(1)
{
while(1)
{

trig waittill ("trigger,other");
if ((isplayer (other)) && (other.pers["team"] == "allies"))
break;
else {
alert = getent ("sound5source", "targetname");
alert playsound("sound5");
wait 2;
}
}
}
}

i hav set every thing properly for sound such as sound and soundaliase stuff.
still i cant solve 1.trigger problem for sound(as mentioned)
2. how to play my own track via trigger for above concept...pls help me
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Saturday, Apr. 21, 2007 01:30 pm
scripting is all about being precise.

trig waittill ("trigger,other");

should be

trig waittill ("trigger",other);

notice the placement of the second ".
Share |
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Monday, Apr. 23, 2007 09:30 pm
It's also about correct structure, your script as is will generate errors I think.

Try this method:
Code:
sound5()
{
trig = getent ("sound5_trigger","targetname");
alert = getent ("sound5source", "targetname");
 while(1)
 {
  trig waittill ("trigger",other);
   if ((isplayer (other)) && (other.pers["team"] == "allies"))
   {
     alert playsound("sound5");
     wait 2;
   }
 }
}


Regards Grassy
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

»