AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   precache_sound (https://forums.alliedmods.net/showthread.php?t=60437)

fxfighter 09-03-2007 13:12

precache_sound
 
This dont work eny suggestions?
Code:


precache_sound("sound/music/%s.mp3",Sound)
 precache_sound("sound/music/%s.mp3",Sound2)
 precache_sound("sound/music/%s.mp3",Sound3)
 precache_sound("sound/music/%s.mp3",Sound4)
 precache_sound("sound/music/%s.mp3",Sound5)


dxteam 09-03-2007 13:18

Re: precache_sound
 
Delete word sound
apply only music/...../......mp3 or wav

fxfighter 09-03-2007 13:21

Re: precache_sound
 
its not a word is a string that contains the name-.-
i use it becase i load a name frome a .ini so i can change the song.
this is the only probl.
and if i do as you say i will be stuck whit the same song forever.

Greenberet 09-03-2007 13:39

Re: precache_sound
 
i would do it like this:
Code:
 // global scope new sounds[][] = {        "music/test/1.wav",        "music/test/2.wav",        "music/test/3.wav",        "music/test/4.wav", } //in plugin_precache int entries = sizeof sounds for( new i = 0; i < entries; i++ )         precache_sound( sounds[i] );

fxfighter 09-03-2007 13:41

Re: precache_sound
 
thx but my probl was how i can make it compile you know .
how to compile it and use the string that Sound contains
Quote:

precache_sound("sound/music/%s.mp3",Sound)
i tryed this way but didnt work so..

Arkshine 09-03-2007 13:45

Re: precache_sound
 
You have to format a string before that.

Something like:

Code:
new CurSnd[128]; formatex( CurSnd, sizeof CurSnd - 1, "sound/music/%s.mp3", Sound ); precache_generic( CurSnd );

fxfighter 09-03-2007 13:47

Re: precache_sound
 
Thx gonna try it i bet it work =)

Reaper2331 09-03-2007 17:02

Re: precache_sound
 
fx if you figure it out, can you PM the code? i wanna mess around with it

vl@d 09-05-2007 14:19

Re: precache_sound
 
found this in amx 2006.3 in miscstats.sma
Code:

new g_precSoundCust[64]
public precache_sound_custom(sound[]) {
  format(g_precSoundCust, 63, "sound/%s.wav", sound)
  if(file_exists(g_precSoundCust)) {
    replace(g_precSoundCust, 63, "sound/", "")
    precache_sound(g_precSoundCust)
  }
}

Hope this will help you :)


All times are GMT -4. The time now is 16:17.

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