Blockland Forums > Modification Help
Playing sounds
(1/1)
mp7964:
I simply want to play a 2D sound to every user on the server when something is announced with my new script.

The current code is this


--- Code: ---function serverCmdAnnounce(%client,%word)
{
    if(!%client.isAdmin) {
        messageClient(%client, "", "\c3Announcing is \c0Admin \c3only.");
        playSound("./sound/anondenied.wav");
        return;
    }

    messageAll("", "\c3Announcement: \c2" @ %word);
    playSound("./sound/announce.wav");

}
--- End code ---

I had a feeling playSound wouldn't work, and I also think it's because I didn't make the sound datablock. Any suggestions?

Also, the script loads fine, but I can't use the serverCmd anymore. It used to work fine, before I did the playSound thingy. Any ideas at all?
Headcrab Zombie:
serverPlay2d(soundDatablockName);
mp7964:

--- Quote from: Headcrab Zombie on September 03, 2011, 02:29:47 AM ---serverPlay2d(soundDatablockName);

--- End quote ---

Ah, so I could just use an existing datablock, like playconnect or admin or something like that?
Navigation
Message Index

Go to full version