搜索
楼主: feikof97

[重要] 死后播放音乐的插件

[复制链接]
发表于 2003-11-26 18:35:33 | 显示全部楼层 来自 中国–广东–深圳–宝安区
/***********************************************************************
* amx_ejl_welcomemessage.sma     version 1.0       July  28/2002
*  By:  Eric Lidman   Alias: Ludwig van       ejlmozart@hotmail.com
*  Upgrade: http://lidmanmusic.com/cs/plugins.html  
*
*   Plays welcome message sound from ..sound/misc folder with
*   filename: welcome_message.wav   The file is precached so it auto
*   downloads to clients provided it is in misc folder on server. A
*   csay style hudmessage appears too with text: Welcome to the Collective
*   Change the say text in code to whatever you want.
*   
**********************************************************************/

#include <amxmod>

public plugin_init(){
   register_plugin("Welcome message", "1.0", "EJL")
   return PLUGIN_CONTINUE
}

public client_putinserver(id){
   new sid[1]
   sid[0] = id
   set_task(3.0,"delayed_welcome",0,sid,1)
   return PLUGIN_CONTINUE
}

public plugin_precache(){
   precache_sound("misc/welcome_message.wav")
   return PLUGIN_CONTINUE
}

public delayed_welcome(id[]){
   new name[32]
   get_user_name(id[0],name,31)
   new Message[192]
   client_cmd(id[0],"play misc/welcome_message.wav")
   format(Message,191,"Hello, %s^nWelcome to the Collective!",name)
   set_hudmessage(12,125,12, -1.0, 0.35, 0, 0.02, 5.0, 1.01, 1.1, 4)         
   show_hudmessage(id[0],Message)
   return PLUGIN_CONTINUE
}
回复

使用道具 举报

发表于 2003-11-26 18:37:40 | 显示全部楼层 来自 中国–广东–深圳–宝安区
上面那个是有人进来就播放欢迎声音的脚本,不知谁会改,我想改一下应该可以的啦。
回复

使用道具 举报

发表于 2003-11-26 18:38:12 | 显示全部楼层 来自 中国–广东–深圳–宝安区
/***************************************************************************
*  amx_ejl_allsound_downloader.sma
*   version 1.2             Date: 1/20/2003
*   Author: Eric Lidman     ejlmozart@hotmail.com
*   Alias: Ludwig van       Upgrade: http://lidmanmusic.com/cs/plugins.html
*
*  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/amx folder called:
*   MASTER_SOUND_DL_LIST.txt, 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.txt 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 <amxmod>

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/amx/MASTER_SOUND_DL_LIST.txt")){
      while((line=read_file("addons/amx/MASTER_SOUND_DL_LIST.txt",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/amx/MASTER_SOUND_DL_LIST.txt","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.2","EJL")
}
回复

使用道具 举报

发表于 2003-11-26 18:38:57 | 显示全部楼层 来自 中国–广东–深圳–宝安区
上面这个是让客户端下载服务器里的音乐。。。
回复

使用道具 举报

发表于 2003-11-26 18:40:56 | 显示全部楼层 来自 中国–广东–深圳–宝安区
这里好象没版主,感觉也很少会写脚本的人进来。。以前好象还多点。郁闷。可惜我不会。。。。
回复

使用道具 举报

发表于 2003-11-28 04:30:00 | 显示全部楼层 来自 中国–天津–天津
对,我觉得就象STATUS里的headshot的音效一样,在特定的时间发出命令,应该不难吧,难者不会,会者不难,高手快来,飘风兄呢
回复

使用道具 举报

发表于 2003-11-28 05:57:23 | 显示全部楼层 来自 中国–北京–北京–海淀区
问题是HEADSHOT的音乐才多大啊?  一首MP3有多大?  再说CS1.5好像播放不了MP3.
回复

使用道具 举报

发表于 2003-11-28 09:53:55 | 显示全部楼层 来自 中国–天津–天津
我靠!你难道不会用midi吗,MP3那么大你认为可能吗?headshot虽小,可一首midi歌曲也不大20-30K,再说可以让他循环着播放
回复

使用道具 举报

发表于 2003-11-28 15:15:03 | 显示全部楼层 来自 中国–湖北–武汉
空喜
回复

使用道具 举报

发表于 2003-11-29 18:42:00 | 显示全部楼层 来自 中国–福建–厦门
目前只有steam才支持mp3播放,对于cs1.5到也可以在客户端播放音乐,但客户端需从服务器端下载音乐(估计大家会等烦的),否则听cs自带的音乐有什么意思呀~
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表