己解决........高手们看一下这代码出在错那啦.帮忙解决一下
本帖最后由 点通粉丝 于 2010-2-2 05:59 编辑CS1.5遁环放歌的代码..刚写好的
测试结果:
op一进服.音乐即响起.这个也是我想要的没问题这个
当第一次音乐放完.遁环第二次时也没问题.当第二次音乐放完.遁环第三次时当然也是没问题.
但到了第四次时问题出来了..这BT.wav音乐.他会有两个音效一起放出的..
到了第五次时.问题就更大了.音效..声音会.增加几倍.简值耳麦都带不了啦...
所以求高手门帮忙解决一下..我就是想让他像.僵尸F那音效一样.重复遁环放歌而儿#include <amxmodx>
#include <amxmisc>
public plugin_init() {
register_plugin("play sound", "1.0", "KIN");
register_event("ShowMenu","sound","b","4&Team_Select")
register_event("VGUIMenu","sound","b","1=2","1=26","1=27")
}
public plugin_precache() {
precache_sound("misc/bt.wav")
return PLUGIN_CONTINUE
}
public sound(id)
{
client_cmd(id,"spk misc/bt.wav")
set_task(40.0,"sound",id,"",0,"a",5)
} set_task(40.0,"sound",
提示:
这40.0.是配合.bt.wav音效的..设40.0刚好 没有用过1.5的,不清楚怎么写
但我觉得你你应该执行任务前,先remove_task(id)而且也要执行暂停播放歌曲,之后再执行你需要播放的歌. 本帖最后由 点通粉丝 于 2010-2-2 05:50 编辑
但是.普通完家进服不会自动去下截这BT.wav音效啊..
这个怎解决???
是不是要加一条代码来.强制完家去下这个音效呢..
问题是我不会啊... 4# 点通粉丝
像这代码..一方胜利欢呼声..他是怎强制完完冢下音效的??//RoundSound.amxx -by PaintLancer
#include <amxmodx>
public plugin_init()
{
register_cvar("cl_round_end", "1");
register_plugin("RoundSound","1.1","PaintLancer&Sha!")
register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")
}
public t_win()
{
new no_winsound
new i=1
while(i<31)
{
get_user_info(i, "no_winsound", no_winsound, 31)
if(!(str_to_num(no_winsound)))
{
new rand = random_num(0,4)
client_cmd(i,"stopsound")
switch(rand)
{
case 0: client_cmd(i,"spk misc/twinnar1")
case 1: client_cmd(i,"spk misc/twinnar2")
case 2: client_cmd(i,"spk misc/twinnar3")
case 3: client_cmd(i,"spk misc/twinnar4")
case 4: client_cmd(i,"spk misc/twinnar5")
}
}
i=i+1
}
return PLUGIN_HANDLED
}
public ct_win()
{
new no_winsound
new i=1
while(i<31)
{
get_user_info(i, "no_winsound", no_winsound, 31)
if(!(str_to_num(no_winsound)))
{
new rand = random_num(0,4)
client_cmd(i,"stopsound")
switch(rand)
{
case 0: client_cmd(i,"spk misc/ctwinnar1")
case 1: client_cmd(i,"spk misc/ctwinnar2")
case 2: client_cmd(i,"spk misc/ctwinnar3")
case 3: client_cmd(i,"spk misc/ctwinnar4")
case 4: client_cmd(i,"spk misc/ctwinnar5")
}
}
i=i+1
}
return PLUGIN_HANDLED
}
public plugin_precache()
{
precache_sound("misc/ctwinnar1.wav")
precache_sound("misc/ctwinnar2.wav")
precache_sound("misc/ctwinnar3.wav")
precache_sound("misc/ctwinnar4.wav")
precache_sound("misc/ctwinnar5.wav")
precache_sound("misc/twinnar1.wav")
precache_sound("misc/twinnar2.wav")
precache_sound("misc/twinnar3.wav")
precache_sound("misc/twinnar4.wav")
precache_sound("misc/twinnar5.wav")
return PLUGIN_CONTINUE
} 5# 点通粉丝
我就搞不明白 这是cs1.52.3版上的代码
bie_swarm.sma 2.3这僵尸源码是怎么了
这个音效precache_sound("zombie_swarm/ambience.wav")差不多5百kB大哦
完家他会自动下截的......
我就是想单读写一个这样的源码用于CS1.5死亡服上而儿都没人帮一下忙吗.. public sound(id)
{
if(is_user_connected(id))
{
client_cmd(id,"spk misc/bt.wav")
set_task(40.0,"sound",id)
}
}sound里调用task执行sound,task函数里就不要加重复次数这个参数了,否则会同时好几个task在执行,所以导致声音很大。 我认为把它转化成MP3只需要播放一次它就不会停止了............ CS1.5不支持MP3格式的啊.......晕
页:
[1]