Once Again, In need of help

Hello, I am working on a Sound Pack for TWM. However I am coming across a few problems.

1) I don't know how to check for files on the client side so the server can call a file check on the client to see if he/she has the sound pack installed

2) The Music files in there work (I tested them on the client side using TMMS) but whenever I call alxPlayMusic on it, it gives me two errors which are alxStartStream: and alxStartStream: failed to get a free source.

3) I want to modify clientAudio.cs to play the new music if they have it, and if they don't, play T2 music.

A little bit of the code
function CheckSndPack(%client) {
%check = CommandToClient(%cl, "DoSoundPackCheck"); // Need to make this
   if(!%check) {
   MessageClient(%client,'WarningMessage',"WARNING: TWM sound pack not detected on your client.");
   MessageClient(%client,'WarningMessage',"You will be unable to hear certain sounds in TWM, please");
   MessageClient(%client,'WarningMessage',"see Phantom139 for information on getting this pack.");
   error("Client "@%client.namebase@" does not have the sound pack");
   }
   else {
   echo("Client "@%client.namebase@" has the sound pack");
   BottomPrint(%client, "TWM Sound Pack Installed");
   }
}

function MP3Audio::playTrack(%this, %trackName)
{
   %this.currentTrack = %trackName;
   if(%this.IHaveSoundPack)
      alxPlayMusic("CCM\\SoundPack\\" @ %trackName @ ".mp3");
   else
      alxPlayMusic(getRandomTrack());
}

Comments

  • Well usually you wouldn't have the server needing to know if the client has the files, since it would all be handled on the clientside. So if you simply made some changes to the existing functions, you could have it play the tracks you want without making a big deal out of it. Everything you need should be in clientAudio.cs. If you really want to talk to the client from the client end, you should be using addMessageHudLine.
    But if you really want the server to know if you have the pack, have it send a command to the client to check if isFile(%filename), and send a command back to the server with a response.
    Make sure there is no music currently playing before you start a new one, or it'll run into an error trying to play it where a track already exists.

    What you might want to do though is have it search for and index mp3s in your directory and choose from those, as making a list and checking it twice can be a bit tedious. Not to mention people could just drop mp3s in the folder and have them load up without any trouble.
  • Hello, I am working on a Sound Pack for TWM. However I am coming across a few problems.

    1) I don't know how to check for files on the client side so the server can call a file check on the client to see if he/she has the sound pack installed

    2) The Music files in there work (I tested them on the client side using TMMS) but whenever I call alxPlayMusic on it, it gives me two errors which are alxStartStream: and alxStartStream: failed to get a free source.

    3) I want to modify clientAudio.cs to play the new music if they have it, and if they don't, play T2 music.

    A little bit of the code
    function CheckSndPack(%client) {
    %check = CommandToClient(%cl, "DoSoundPackCheck"); // Need to make this
    if(!%check) {
    MessageClient(%client,'WarningMessage',"WARNING: TWM sound pack not detected on your client.");
    MessageClient(%client,'WarningMessage',"You will be unable to hear certain sounds in TWM, please");
    MessageClient(%client,'WarningMessage',"see Phantom139 for information on getting this pack.");
    error("Client "@%client.namebase@" does not have the sound pack");
    }
    else {
    echo("Client "@%client.namebase@" has the sound pack");
    BottomPrint(%client, "TWM Sound Pack Installed");
    }
    }
     
    function MP3Audio::playTrack(%this, %trackName)
    {
    %this.currentTrack = %trackName;
    if(%this.IHaveSoundPack)
    alxPlayMusic("CCM\\SoundPack\\" @ %trackName @ ".mp3");
    else
    alxPlayMusic(getRandomTrack());
    }
    
    Don't bother me for help... your the guy who banned me.
  • ...your the guy who banned me.

    He bans everyone. :)
    I'm pretty sure I've been banned from his server by now, but I don't really care.
  • Don't bother me for help... your the guy who banned me.

    You were given a fair warning to not use the killfield, but you did not listen. And besides. It was a server glitch, you were only kicked, not banned.

    Blnukem, the last time you were banned is when you kicked me out of your server for no reason about 7-8 months ago.
  • Don't bother me for help... your the guy who banned me.

    grow up?
  • Phantom, you should know by now that most of us dislike you.


    ~Syn
  • Phantom, you should know by now that most of us dislike you.


    ~Syn

    You should have figured I would strike back on this with the fact that more people hate you than they do me.
  • I already did. It's too bad that your 'facts' lack truth. I will not continue this pointless argument.


    ~Syn~
  • I will not continue this pointless argument.


    :o
  • *Rolls the dice, gets a 2*
    Im on synors team.
  • I still wonder why everyone calls me "Synor" when I always sign off with "Syn"... by the way, it's pronounced the same as "sin". "Sin-oh-rith". Just to clear any confusion.


    ~Syn~
  • You're all dumb.

    The end.
  • According to my signature, you really do need help.
  • According to my signature, you really do need help.

    I rofled at the second one.


    ~Syn~
Sign In or Register to comment.