Home   Help Search Login Register  

Author Topic: get in vehicle, play sound  (Read 671 times)

0 Members and 1 Guest are viewing this topic.

illmatic

  • Guest
get in vehicle, play sound
« on: 10 Apr 2004, 13:45:07 »
?:vehicle player == player : goto "takeoff"

#takeoff

playsound "takeoff"

am i doing this correct, i get unknown operator, when a player enters the cessna i want the sound to be played but so only he can hear it, but everyone can here this i think

illmatic

  • Guest
Re:get in vehicle, play sound
« Reply #1 on: 10 Apr 2004, 13:50:00 »
i have a feeling i shouldnt of made the empty unit exec that script, should i define the name of the plane in the script, help please someone  ??? ??? ???

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:get in vehicle, play sound
« Reply #2 on: 10 Apr 2004, 14:36:26 »
Is your sound defined in the description.ext file in your mission folder?


Planck
I know a little about a lot, and a lot about a little.

illmatic

  • Guest
Re:get in vehicle, play sound
« Reply #3 on: 10 Apr 2004, 14:43:05 »
it is ya

class CfgSounds
{
sounds[] = {takeoff, sound};

class takeoff
{
name = "takeoff";
sound[] = {"takeoff.ogg", db+120, 1.0};
titles[] =

{
};
};

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:get in vehicle, play sound
« Reply #4 on: 10 Apr 2004, 15:01:55 »
Try this:

class CfgSounds
{
   sounds[] = {takeoff};

   class takeoff
   {
      name = "takeoff";
      sound[] = {"takeoff.ogg", db+120, 1.0};
      titles[] = { }
   };
};


Planck
I know a little about a lot, and a lot about a little.

illmatic

  • Guest
Re:get in vehicle, play sound
« Reply #5 on: 10 Apr 2004, 16:39:32 »
ty sounds working ok, but i still need to get the script to work when the player enters the vehicle

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:get in vehicle, play sound
« Reply #6 on: 10 Apr 2004, 16:46:01 »
Your example:

?:vehicle player == player : goto "takeoff"

is not correct.

Try this one:

? vehicle player != player : goto "takeoff"


Planck
I know a little about a lot, and a lot about a little.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:get in vehicle, play sound
« Reply #7 on: 10 Apr 2004, 16:57:10 »
And just for info:

?:vehicle player == player: goto "takeoff"

creates an error because you made a mistake

?vehicle player == player: goto "takeoff"

would have been the correct syntax

:note the :

Off course Planck already sorted that error out when posting
the correct solution for your problem.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

illmatic

  • Guest
Re:get in vehicle, play sound
« Reply #8 on: 10 Apr 2004, 17:12:20 »
thanks guys, im using "this exec "cessnasound.sqs" in the planes init field and it plays the sound right away, how could i only make the sound appear if someone goes into that plane, and only that plane no other vehicle???

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:get in vehicle, play sound
« Reply #9 on: 10 Apr 2004, 17:35:57 »
dunno exactly, how you did setup your script, but what about
a condition like:

?vehicle whoever == exactly_that_plane: goto "takeoff"

 ;)

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

illmatic

  • Guest
Re:get in vehicle, play sound
« Reply #10 on: 10 Apr 2004, 18:13:36 »
-------------------------------------------------------------

?vehicle guy1 == cessna1: goto "takeoff"
#takeoff

playsound "takeoff"

-------------------------------------------------------------

how should i exec the script, and the sound just plays.... i need it so, if guy1 enters the plane, the sound goes off so only he can here, and should i exec the script in the guys1 init or the planes??? ??? ??? ???

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:get in vehicle, play sound
« Reply #11 on: 10 Apr 2004, 19:06:35 »
If what you posted is your script.........

?vehicle guy1 == cessna1: goto "takeoff"
#takeoff

playsound "takeoff"

Then what this does is:

1./ It checks if guy1 is in the cessna

2./ If he is it goes to "takeoff"

3./ If he isn't in the cessna it goes to the next line which is "takeoff"

4./ It drops through this to the following line and plays the sound.

So........in effect your script plays the sound whether guy1 is in the cessna or not.

Try this:

#check
?vehicle guy1 == cessna1: goto "takeoff"
~0.2
goto "check"

#takeoff

playsound "takeoff"



Planck
« Last Edit: 10 Apr 2004, 19:07:50 by Planck »
I know a little about a lot, and a lot about a little.

illmatic

  • Guest
Re:get in vehicle, play sound
« Reply #12 on: 10 Apr 2004, 19:21:30 »
thanks once again planck, is there anyway i can make only guy1 hear the sound when he enters the plane, because others can hear it as well soon as the activates #takeoff
« Last Edit: 10 Apr 2004, 19:21:53 by illmatic »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:get in vehicle, play sound
« Reply #13 on: 10 Apr 2004, 19:27:35 »
Sorry......that one is beyond my knowledge as I very very seldom dabble with multiplayer stuff.

You might have to wait for someone else to help with that one.


Planck
I know a little about a lot, and a lot about a little.

illmatic

  • Guest
Re:get in vehicle, play sound
« Reply #14 on: 10 Apr 2004, 20:09:55 »
ty anywayz. i'll make a new topic in the multiplayer forum as its abit off the main subject