Puma Posted April 9, 2010 Share Posted April 9, 2010 Hi, I know this has been asked several times already, but I just haven't found what I'm looking for. I want to script a command which will result in a sound being played for everyone. Now, I've searched quite a lot and I found some topics about the radiostation-script, but that wasn't what I needed: I just want something that manipulates the "playSound"-clientside-function so that the sound is played to all players at the same time. Is it even possible to script it? Link to comment
MaddDogg Posted April 9, 2010 Share Posted April 9, 2010 You could script the command server-side and then trigger a client event to play the sound for every player. This could look like this: Server-side: addCommandHandler("sound", function (player) triggerClientEvent("onSoundRequest", player) end ) Client-side: addEvent("onSoundRequest", true) addEventHandler("onSoundRequest", getRootElement(), function () playSound("sounds/mySound.mp3") end ) Link to comment
Puma Posted April 9, 2010 Author Share Posted April 9, 2010 Hm, ok, thanks, I get what you mean, gonna try it. Thanks! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now