Raised This Month: $ Target: $400
 0% 

precache_sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-03-2007 , 13:12   precache_sound
Reply With Quote #1

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)
__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
dxteam
Senior Member
Join Date: Dec 2005
Old 09-03-2007 , 13:18   Re: precache_sound
Reply With Quote #2

Delete word sound
apply only music/...../......mp3 or wav
dxteam is offline
Send a message via ICQ to dxteam
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-03-2007 , 13:21   Re: precache_sound
Reply With Quote #3

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.
__________________
If one of my plugins become broken, contact me by mail. [email protected]

Last edited by fxfighter; 09-03-2007 at 13:27.
fxfighter is offline
Send a message via MSN to fxfighter
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 09-03-2007 , 13:39   Re: precache_sound
Reply With Quote #4

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] );
__________________
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-03-2007 , 13:41   Re: precache_sound
Reply With Quote #5

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..
__________________
If one of my plugins become broken, contact me by mail. [email protected]

Last edited by fxfighter; 09-03-2007 at 13:45.
fxfighter is offline
Send a message via MSN to fxfighter
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-03-2007 , 13:45   Re: precache_sound
Reply With Quote #6

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 );
__________________
Arkshine is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-03-2007 , 13:47   Re: precache_sound
Reply With Quote #7

Thx gonna try it i bet it work =)
__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 09-03-2007 , 17:02   Re: precache_sound
Reply With Quote #8

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

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
vl@d
Senior Member
Join Date: Dec 2006
Location: Romania
Old 09-05-2007 , 14:19   Re: precache_sound
Reply With Quote #9

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
__________________


I hate Spammers....
vl@d is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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