Raised This Month: $12 Target: $400
 3% 

(Ludwig van) cache.amxx Sound Download Manager 1.0


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management       
[nFb]GraveKeeper
Senior Member
Join Date: Mar 2004
Location: Connecticut, U.S.A.
Old 03-31-2004 , 01:43   (Ludwig van) cache.amxx Sound Download Manager 1.0
Reply With Quote #1

This plugin will manage the downloading of custom sounds and models to clients who connect to your server. Read the instructions at the top of .sma file on how to use this.

Code:
/***************************************************************************  *  amx_ejl_allsound_downloader.sma  *   version 1.3             Date: 1/20/2003  *   updated 8th Sept to work with AMX 0.99  *   Author: Eric Lidman     <a href="mailto:[email protected]">[email protected]</a>  *   Alias: Ludwig van       Upgrade: <a href="http://lidmanmusic.com/cs/plugins.html" target="_blank" rel="nofollow noopener">http://lidmanmusic.com/cs/plugins.html</a>  *  *  This a a system for managing your sound downloads to clients. You can  *   specify some sounds to download to clients regardless of the map they  *   join on, also you can make some sounds only download to clients for  *   certain maps. The advantages of using this plugin instead of res files  *   are many. If you want sounds to download to clients no matter what map  *   they play on, you need to specify that sound in every single .res file.  *   Also, this simplifies the management of sound downloads. It is easier to  *   see what you are downloading to people if you have a single list to work  *   of off rather than a zillion individual .res files.  *  *  Setup: You should create a file in your ..addons/amxmodx/configs folder called:  *   master_sound_dl_list.cfg, if you dont, the server will make one for you  *   which you can modify and add to as you please. That file should be set  *   up like thisup like this:  *  *   FORMAT:       ACTUAL EXAMPLE:  *  *   #ALL          #ALL  *   sound         lol.wav  *  *   #mapname      #de_dust  *   sound         gnyso/2_bonjour.wav  *   sound         misc/PartyMusic.wav  *  *   #mapname      #cs_italy  *   sound         gnyso/2_ELMO.wav  *  *  Download as many as you want, but see warning-2 below.      *  *  Warning-1: Unlike .res files, you should not put "sound" in the path to  *   your sound. sound/something.wav should be listed as simply something.wav  *   if the list file. sound/misc/elmo.wav would be misc/elmo.wav and so on.  *  *  Warning-2: Be aware of how much you are downloading to people. I have a  *   standard where I limit sound downloads to 300kb per map or thereabouts.  *   That takes the average client 1-2 minutes to download off your server.  *   #ALL counts for every map, so take that into account when figuring how  *   much you can get away with downloading to a client before they lose  *   patience and decide to drop and go to another server where they can  *   actually play and not have to wait years for your downloads to finish.  *  *  NEW: Can download sprites and models as well. For this type of download  *   the default path is not sound, it is your mod directory. These files  *   you may include right along with the sounds in the same  *   master_sound_dl_list.cfg file. Examples:  *  *      #ALL  *      models/bowling_ball.mdl  *      vox/lol.wav  *  *      #de_dust  *      gnyso/2_bonjour.wav  *      misc/PartyMusic.wav  *      sprites/scary_ghost.spr  *  *  *  Acknowledgements:  *   Spacedude from the AMX forums for coming up with the original idea for  *   this plugin and writing its rough draft.  *  ***************************************************************************/ #include <amxmodx> public plugin_precache() {     new ThisMap[32]     get_mapname(ThisMap, 32)          new soundfile[128]     new line     new txtlen     new prec_on = 0     if (file_exists("addons/amxmodx/configs/master_sound_dl_list.cfg")){         while((line=read_file("addons/amxmodx/configs/master_sound_dl_list.cfg",line,soundfile,128,txtlen))!=0){             if(equal(soundfile[0],"#",1)){                 if(prec_on == 1)                     prec_on = 0                 if( (equali(soundfile[1],ThisMap)) || (equali(soundfile[1],"ALL",3)) )                     prec_on = 1             }else{                 if(containi(soundfile,".wav") != -1){                     if(prec_on == 1){                         precache_sound(soundfile)                     }                 }                 else if(containi(soundfile,".spr") != -1){                     if(prec_on == 1){                         precache_model(soundfile)                     }                 }                 else if(containi(soundfile,".mdl") != -1){                     if(prec_on == 1){                         precache_model(soundfile)                     }                 }                 else if(containi(soundfile,".wad") != -1){                     if(prec_on == 1){                         precache_model(soundfile)                     }                 }             }         }     }else{         write_file("addons/amxmodx/configs/master_sound_dl_list.cfg","master download list for sounds - replaces res files. Format: read top of .sma file",-1)     }     return PLUGIN_CONTINUE } public plugin_init(){     register_plugin("SOUND DOWNLOAD MANAGEMENT","1.3","EJL") }
Attached Files
File Type: sma Get Plugin or Get Source (cache.sma - 4589 views - 4.3 KB)
[nFb]GraveKeeper is offline
Send a message via AIM to [nFb]GraveKeeper
[nFb]GraveKeeper
Senior Member
Join Date: Mar 2004
Location: Connecticut, U.S.A.
Old 04-08-2004 , 03:50  
Reply With Quote #2

I have this currently working on a Steam Linux 1.6 CS server and a Windows CS Server. It has been working great.
[nFb]GraveKeeper is offline
Send a message via AIM to [nFb]GraveKeeper
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-08-2004 , 07:14  
Reply With Quote #3

oh uh.. hardcoded paths... this won't get approved
__________________
My Plugins

Got ??
AssKicR is offline
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-08-2004 , 07:18  
Reply With Quote #4

here is a version that will get aproved
Attached Files
File Type: sma Get Plugin or Get Source (sound_download_management.sma - 2787 views - 4.2 KB)
__________________
My Plugins

Got ??
AssKicR is offline
DoubleTap
Veteran Member
Join Date: Mar 2004
Location: Harker Heights, TX
Old 04-08-2004 , 23:27  
Reply With Quote #5

Dude, this should have been deleted because it mirrors my port (mine was first) and I believe my code is already corrected...

Vic/DT
__________________
DoubleTap is offline
Send a message via ICQ to DoubleTap
[nFb]GraveKeeper
Senior Member
Join Date: Mar 2004
Location: Connecticut, U.S.A.
Old 04-10-2004 , 00:32  
Reply With Quote #6

No doubt.
[nFb]GraveKeeper is offline
Send a message via AIM to [nFb]GraveKeeper
tron73
Senior Member
Join Date: Apr 2004
Location: Schulzendorf / germany
Old 05-25-2004 , 20:32   Bug with czero
Reply With Quote #7

Hi all,

I use(d) the plugin on my private cz-dedi (linux) with some custom-maps, I generated bot-nav-files for. When using the plugin I got:


SCHNIPP

Host_Error: PF_precache_sound_I: Sound 'debris/bustcrate2.wav' failed to precache because the item count
is over the 512 limit.
Reduce the number of brush models and/or regular models in the map to correct this.
FATAL ERROR (shutting down): Host_Error: PF_precache_sound_I: Sound 'debris/bustcrate2.wav' failed to pr
ecache because the item count is over the 512 limit.
Reduce the number of brush models and/or regular models in the map to correct this.

SCHNAPP

on random maps, especially de_rust

I dont know, what to do?! Okay, its not such a big problem, there are of course other plugins and the res.file-download, but perhaps it can help finding out some errors.
__________________


Debian LAMP
AMD 64 3700+
2xCS:S
tron73 is offline
Send a message via ICQ to tron73
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 05-25-2004 , 21:44  
Reply With Quote #8

You have too many sounds/files to download
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
tron73
Senior Member
Join Date: Apr 2004
Location: Schulzendorf / germany
Old 05-26-2004 , 05:51  
Reply With Quote #9

Okay, there is no problem to use another way to download the sounds, but I was wondering about the random crashes.

Is it possible to kill the bug, if I make different parts in the MASTER-SOUND-DOWNLOAD.cfg, such


SCHNIPP


de_dust
misc/blabla.wav
misc/..

de_dust2_cz
misc/hurra.wav
misc/...

SCHNAPP

and so on? Until now I used only

genral

misc/blabla.wav
misc/hurra.wav
.
.
.
__________________


Debian LAMP
AMD 64 3700+
2xCS:S
tron73 is offline
Send a message via ICQ to tron73
ncincott
Member
Join Date: Jun 2004
Old 07-08-2004 , 14:14  
Reply With Quote #10

How do you tell the server when to play the sounds tho? For instance, how do I switch the wav files for headshots and such?
ncincott 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 07:46.


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