Home   Help Search Login Register  

Author Topic: Sound in MP  (Read 3607 times)

0 Members and 1 Guest are viewing this topic.

Offline Jh62

  • Members
  • *
Sound in MP
« on: 18 Aug 2012, 06:50:27 »
Hi.

I have a script where I control a unit.

I only let the server execute the file, because i don't want the client and the server fighting each other wheter the unit should go one way or another (altough the server is always right), so for this reason I execute it locally.

the problem is that when this unit play's a sound, it can only be heard on the local machine.

I've tried creating an invisible unit or gamelogic and make it play the sound (command "say"), but since the unit it's creating locally, the results are the same.

It's basically a zombie script that when you are close, it hits you, so every time this happens a sound is played.

I need that sound to be heard on all computers at the same time (with command "say"), but I can't figure out how.


Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Sound in MP
« Reply #1 on: 18 Aug 2012, 09:08:49 »
I'm no expert when it comes to multiplayer editing, but perhaps the 'playsound' command will work?  :scratch:

Code: [Select]
playsound "sound"
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline faguss

  • Members
  • *
    • Faguss' Website
Re: Sound in MP
« Reply #2 on: 23 Aug 2012, 13:13:48 »
Commands say and playSound are local. You have to execute them on all machines if you want to achieve a global effect.

Detect action locally (in this example run a script checking if player is hit by a zombie) and then play the sound. In other instances use publicVariable to transmit information