Author Topic: Playing sounds  (Read 296 times)

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: [Select]
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");

}

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?

serverPlay2d(soundDatablockName);

serverPlay2d(soundDatablockName);

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