AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Play .waw file (https://forums.alliedmods.net/showthread.php?t=313029)

TudorLaLeagane 12-25-2018 18:18

[HELP] Play .waw file
 
Hi! I just want to play a .waw file.

Here is part of my code:

Code:

new SoundNames[SoundNR][] =
{
        "Yes",
        "May The Force Be With You",
        "Helloo Babee",
        "The One and Only"
}
new SoundNamesID[SoundNR][] =
{
        "yes.waw",
        "FORCE.WAW",
        "HIBABE.WAW",
        "THEONE.WAW"
}

and

Code:

        new Name[33]
        get_user_name(id,Name,charsmax(Name))
        if(SoundID[id][item] == 1)
        {
                chat_color(id,"!y[!gSOUNDS!y]!g Ai ales !team%s !gsunetul va fi aplicat!",SoundNames[item])
                new sBuffer[128]
                format(sBuffer,127,"^"%s^"",SoundNamesID[item])
                emit_sound(id,CHAN_AUTO,sBuffer,VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                //client_cmd( 0, "spk ^"%s^"", SoundNamesID[item] );
                HasSound[id] = 1
                format(HSoundID[id],31,"%s",SoundNamesID[item])
                chat_color(0,"!y[!gSOUNDs!y]!g Jucatorul !team%s !ga ales sunetul !team%s!g!",Name,SoundNames[item])
        }

It doesn't want to play in any way possible...

EDIT: PRECACHE
Code:

precache_sound("FORCE.WAW")
        precache_sound("HIBABE.WAW")
        precache_sound("THEONE.WAW")
        precache_sound("yes.waw")


Bugsy 12-25-2018 20:41

Re: [HELP] Play .waw file
 
Try .wav instead of .waw?

TudorLaLeagane 12-26-2018 15:12

Re: [HELP] Play .waw file
 
Yeah... Now it's downloading the file, but it doesn't play it

Bugsy 12-26-2018 17:45

Re: [HELP] Play .waw file
 
Show your full code.

TudorLaLeagane 12-27-2018 04:52

Re: [HELP] Play .waw file
 
I managed to make it play. Here is the code that runs as it should:
Code:

new SoundNames[SoundNR][] =
{
        "Yes",
        "May The Force Be With You",
        "Helloo Babee",
        "The One and Only",
        "YMCA"
}
new SoundNamesID[SoundNR][] =
{
        "misc/yes.wav",
        "misc/FORCE.WAV",
        "misc/HIBABE.WAV",
        "misc/THEONE.WAV",
        "misc/YMCA.WAV"
}

Code:

new Name[33]
        get_user_name(id,Name,charsmax(Name))
        if(SoundID[id][item] == 1)
        {
                chat_color(id,"!y[!gSOUNDS!y]!g Ai ales !team%s !gsunetul va fi aplicat!",SoundNames[item])
                client_cmd( id, "spk ^"%s^"", SoundNamesID[item] );
                HasSound[id] = 1
                format(HSoundID[id],31,"%s",SoundNamesID[item])
                chat_color(0,"!y[!gSOUNDs!y]!g Jucatorul !team%s !ga ales sunetul !team%s!g!",Name,SoundNames[item])
        }

Code:

precache_sound("misc/FORCE.WAV")
        precache_sound("misc/HIBABE.WAV")
        precache_sound("misc/THEONE.WAV")
        precache_sound("misc/yes.wav")
        precache_sound("misc/YMCA.WAV")


eat1k 12-27-2018 06:55

Re: [HELP] Play .waw file
 
Why .WAV instead of .wav?

TudorLaLeagane 12-27-2018 16:47

Re: [HELP] Play .waw file
 
It's just that i just copied the file name, and it was all Upper Case and i was just lazy to change it.

OciXCrom 12-28-2018 08:39

Re: [HELP] Play .waw file
 
Use "spk misc/yes.wav" in your console to see if the sound is even working in CS.

TudorLaLeagane 12-28-2018 12:05

Re: [HELP] Play .waw file
 
It works now, with that code, but idk why it didn't worked with the first implementation

Bugsy 12-28-2018 12:26

Re: [HELP] Play .waw file
 
You are missing the "misc/" folder path?


All times are GMT -4. The time now is 07:38.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.