icely
发表于 2003-11-26 18:35:33
/***********************************************************************
* amx_ejl_welcomemessage.sma version 1.0 July28/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
sid = 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
get_user_name(id,name,31)
new Message
client_cmd(id,"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,Message)
return PLUGIN_CONTINUE
}
icely
发表于 2003-11-26 18:37:40
上面那个是有人进来就播放欢迎声音的脚本,不知谁会改,我想改一下应该可以的啦。
icely
发表于 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
get_mapname(ThisMap, 32)
new soundfile
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,"#",1)){
if(prec_on == 1)
prec_on = 0
if( (equali(soundfile,ThisMap)) || (equali(soundfile,"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")
}
icely
发表于 2003-11-26 18:38:57
上面这个是让客户端下载服务器里的音乐。。。
icely
发表于 2003-11-26 18:40:56
这里好象没版主,感觉也很少会写脚本的人进来。。以前好象还多点。郁闷。可惜我不会。。。。
huajiayu
发表于 2003-11-28 04:30:00
对,我觉得就象STATUS里的headshot的音效一样,在特定的时间发出命令,应该不难吧,难者不会,会者不难,高手快来,飘风兄呢
猪头三
发表于 2003-11-28 05:57:23
问题是HEADSHOT的音乐才多大啊?一首MP3有多大?再说CS1.5好像播放不了MP3.
huajiayu
发表于 2003-11-28 09:53:55
我靠!你难道不会用midi吗,MP3那么大你认为可能吗?headshot虽小,可一首midi歌曲也不大20-30K,再说可以让他循环着播放
liuxujxjxjx
发表于 2003-11-28 15:15:03
空喜
飘风
发表于 2003-11-29 18:42:00
目前只有steam才支持mp3播放,对于cs1.5到也可以在客户端播放音乐,但客户端需从服务器端下载音乐(估计大家会等烦的),否则听cs自带的音乐有什么意思呀~