AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Issue with precache sound (https://forums.alliedmods.net/showthread.php?t=164238)

Doc-Holiday 08-09-2011 01:06

Issue with precache sound
 
For some reason my games telling me it cant precache the sounds
There on the server and fast dl they download to the client but they dont play...

PHP Code:

new const g_medic_calls[][] =
{
"xtrememedic/medic_call1.wav",
"xtrememedic/medic_call2.wav",
"xtrememedic/medic_call3.wav",
"xtrememedic/medic_call4.wav"
};

new const 
g_medic_done[] = "xtrememedic/medic_done.wav";
new const 
g_medic_heal[] = "xtrememedic/medic_healing.wav";

public 
plugin_precache()
{
for(new 
0sizeof(g_medic_calls); i++)
{
precache_sound(g_medic_calls[i]);
}

precache_sound(g_medic_done);
precache_sound(g_medic_heal);
}

emit_sound(idCHAN_ITEMg_medic_heal1.0ATTN_NORM0PITCH_NORM);
emit_sound(idCHAN_ITEMg_medic_calls[random(sizeof(g_medic_calls))], 1.0ATTN_NORM0PITCH_NORM);
emit_sound(idCHAN_ITEMg_medic_done1.0ATTN_NORM0PITCH_NORM); 

There ya go... how they are delcared, precached, and used

I dont see a damn thing wrong with them.


EDIT : No idea wtf was going on... but fixed now

Hunter-Digital 08-09-2011 04:14

Re: Issue with precache sound
 
most likely you were adding "sound" path to it which isn't required, precache_sound() starts in sound folder, the other precache functions start in mod dir (cstrike for example).

But why don't you leave the original post be ?

Doc-Holiday 08-09-2011 06:06

Re: Issue with precache sound
 
Quote:

Originally Posted by Hunter-Digital (Post 1528763)
most likely you were adding "sound" path to it which isn't required, precache_sound() starts in sound folder, the other precache functions start in mod dir (cstrike for example).

But why don't you leave the original post be ?

What you mean i didnt change this one...

That is the original post thats what i dont get.. lol looks fine to me and then all of a sudden started working haha

avril-lavigne 08-09-2011 06:31

Re: Issue with precache sound
 
when you precache
you are using
precache_sound

it means that it starts to precache INSIDE of /cstrike/sound folder

you dont have to write precache_sound("SOUND/ ... dont do this
only use for mp3s precache_generic("sound/ ,,,, bla bla.mp3 )

check path`s once again. check if Hz of sound is correct , try to play the sound from cs console.

Hunter-Digital 08-09-2011 07:01

Re: Issue with precache sound
 
Quote:

Originally Posted by Doc-Holiday (Post 1528804)
What you mean i didnt change this one...

That is the original post thats what i dont get.. lol looks fine to me and then all of a sudden started working haha

Yes, that is the original post, reverted by arkshine, but when I posted it was edited by you and it had no codes or anything of this length, it was just saying that you solved it, but what, I had no clue :)

Also, if you didn't get what I was saying about paths:
precache_sound("file.wav") == "mod/sound/file.wav"
precache_model("file.spr") == "mod/file.spr"
precache_generic("file.mp3") == "mod/file.mp3"
If you still don't get it... try harder because I won't explain again.

Doc-Holiday 08-10-2011 02:36

Re: Issue with precache sound
 
i know what they mean... i know how they are used the question i had weasnt about that... so i have no idea wtf your talking about and why your going on about that lol

I was asking why the code wasnt working... All of a sudden it started working.

Hunter-Digital 08-10-2011 04:41

Re: Issue with precache sound
 
Code doesn't *suddenly* work, there are various things that could have happen and it's pointless to go over them now :}

Doc-Holiday 08-10-2011 05:30

Re: Issue with precache sound
 
Quote:

Originally Posted by Hunter-Digital (Post 1529415)
Code doesn't *suddenly* work, there are various things that could have happen and it's pointless to go over them now :}

im not saying it just started working but i dont get why i cant precache a sound when the code was correct the only thing i changed else in the code was set a task for 0.05 seconds because when you press 'use' it gives off a beep sound... and it plays over the medic sound.

modernwarfare 08-19-2011 17:10

Re: Issue with precache sound
 
i think the problem was with me

but it fixed :) thx


All times are GMT -4. The time now is 03:29.

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