发布:杀敌音效以及字幕显示插件的源码!!
只上传了源码,音效包我没有上传,因为有点大,不想浪费你们的点通币去下载音效,所以音效呢,你们可以在源码面修改然后添加自己喜爱的音效!!字幕现在都为英文,自己改为喜欢的中文吧!! 不错啊! 顶拉! include <amxmod>#define KNIFFMESSAGES 4
#define HEMESSAGES 4 /* Number of Random Messages for Normal HE Kills */
#define HESMESSAGES4 /* Number of Random Messages for Suicide HE Kills */
#define LEVELS 15
#define MESSAGESNOHP 4
#define MESSAGESHP 4
new planter
new defuser
new c4timer
new defusing
new Float:last_omg
new Float:last_plan
new kills = {0,...};
new deaths = {0,...};
new alone_ann = 0
new levels = {1, 2, 3, 4, 5, 7, 9, 10, 12, 13, 14, 16, 18, 20, 21};
new stksounds[] = {"misc/head", "misc/covert1", "misc/covert5", "misc/head",
"misc/head", "misc/covert5", "misc/covert8", "misc/covert1", "misc/covert4",
"misc/covert5", "misc/covert8", "misc/covert4", "misc/covert5", "misc/covert1", "misc/covert1"};
new stkmessages[] = {"", "", "", "", "",
"", "", "", "", "",
"", "", "", "", ""};
new kniffmessages[] = {
"",
"",
"",
""}
new he_messages[] = {
"",
"",
"",
""} /* Random Messages for Normal HE Kills */
new hes_messages[] = {
"",
"",
"",
""} /* Random Messages for Suicide HE Kills */
new messagesnohp[] = {"",
"",
"",
""}
new messageshp[] = {"",
"",
"",
""}
get_streak() {
new streak
get_cvar_string("streak_mode",streak,2)
return read_flags(streak)
}
get_bemode() {
new bemode
get_cvar_string("bomb_mode",bemode,9)
return read_flags(bemode)
}
public death_event(id) {
new streak = get_streak()
if ((streak&1) || (streak&2)){
new killer = read_data(1);
new victim = read_data(2);
kills += 1;
kills = 0;
deaths = 0;
deaths += 1;
for (new i = 0; i < LEVELS; i++) {
if (kills == levels) {
announce(killer, i);
return PLUGIN_CONTINUE;
}
}
}
return PLUGIN_CONTINUE;
}
announce(killer, level) {
new streak = get_streak()
if (streak&1){
new name;
get_user_name(killer, name, 32);
set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2);
show_hudmessage(0, stkmessages, name);
}
if (streak&2){
client_cmd(0, "spk %s", stksounds);
}
}
public reset_hud(id) {
new streak = get_streak()
if (streak&1){
if (kills > levels) {
client_print(id, print_chat,
"", kills);
} else if (deaths > 1) {
client_print(id, print_chat,
"", deaths);
}
}
}
public client_connect(id) {
new streak = get_streak()
if ((streak&1) || (streak&2)){
kills = 0;
deaths = 0;
}
}
public got_bomb(id){
new bemode = get_bemode()
if (bemode&1){
planter = id
defuser = defusing = 0
if ((read_data(1)==2) && (last_omg < get_gametime())){
new bplayers_t, numte
get_players(bplayers_t,numte,"e","TERRORIST")
last_omg = get_gametime() + 15.0
new name
get_user_name(planter, name , 32)
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(bplayers_t,"",name)
}
}
}
public bdef_g(id){
new bemode = get_bemode()
if (read_data(1) == 3){
if (last_plan < get_gametime()){
if (bemode&2){
new bplayers_t, numte
get_players(bplayers_t,numte,"e","TERRORIST")
last_plan = get_gametime() + 15.0
new name
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
get_user_name(planter, name , 32)
show_hudmessage(bplayers_t,"",name)
}
}
}
else {
defuser = defusing = id
if (last_plan < get_gametime()){
if (bemode&4){
new bplayers_ct, numct
get_players(bplayers_ct,numct,"e","CT")
last_plan = get_gametime() + 15.0
new name
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
get_user_name(defusing, name , 32)
show_hudmessage(bplayers_ct,"",name)
}
}
}
}
public bdef_l(id)
defusing = 0
public disable_c4(){
c4timer = 0
last_plan = 0.0
last_omg = 0.0
remove_task(8038)
}
public bomb_planted(){
new bemode = get_bemode()
if (bemode&256){
client_cmd(0,"spk djeyl/c4start")
}
if (bemode&8){
new name
get_user_name(planter, name , 32)
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(0,"",name)
c4timer = get_cvar_num("mp_c4timer") - 2
set_task(1.0,"bomb_c",8038,"",0,"b")
last_plan = 0.0
}
}
public bomb_c(){
new bemode = get_bemode()
if (--c4timer > 0){
if (c4timer == 30 || c4timer == 20){
if (bemode&256){
new temp
num_to_word(c4timer,temp,48)
client_cmd(0,"spk ^"vox/%s seconds until explosion^"",temp)
}
}
else if (c4timer < 11){
if (bemode&256){
new temp
num_to_word(c4timer,temp,48)
client_cmd(0,"spk ^"vox/%s^"",temp)
}
}
if (defusing)
client_print(defusing,print_center,"%d",c4timer)
}
else{
remove_task(8038)
}
}
public bomb_defused(){
new bemode = get_bemode()
if (bemode&256){
client_cmd(0,"spk djeyl/goal_1")
}
if (bemode&16){
new name
get_user_name(defuser, name , 32)
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(0,"",name)
disable_c4()
}
}
public bomb_failure(){
new bemode = get_bemode()
if (defuser){
if (bemode&256){
client_cmd(0,"spk djeyl/dead")
}
if (bemode&32){
new name
get_user_name(defuser, name , 32)
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(0,"",name)
}
}
}
public bomb_pickup(id){
new bemode = get_bemode()
if (bemode&64){
new bplayers_t, numte
get_players(bplayers_t,numte,"e","TERRORIST")
new name
get_user_name(id, name , 32)
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(bplayers_t,"",name)
}
}
public bomb_drop(){
new bemode = get_bemode()
client_cmd(0,"spk vox/woop")
if (bemode&128){
new bplayers_t, numte
get_players(bplayers_t,numte,"e","TERRORIST")
new name
get_user_name(planter, name , 32)
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(bplayers_t,"",name)
}
}
public he_kills(){
new killer_id = read_data(1)
new victim_id = read_data(2)
new killer_name, victim_name
get_user_name(killer_id,killer_name,33)
get_user_name(victim_id,victim_name,33)
new hekmode
get_cvar_string("hekill_mode",hekmode,8)
new hekmode_bit = read_flags(hekmode)
if (hekmode_bit & 1) {
if (victim_id != killer_id)
{
if (hekmode_bit & 4) {
client_cmd(0,"spk djeyl/dead")
}
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(0,he_messages[ random_num(0,HEMESSAGES-1)],killer_name,victim_name)
}
}
if (hekmode_bit & 2) {
if (victim_id == killer_id)
{
if (hekmode_bit & 4) {
client_cmd(0,"spk djeyl/dead")
}
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(0,hes_messages[ random_num(0,HESMESSAGES-1) ],victim_name)
}
}
} //接上面的
public knife_kill(){
new kniffmode
get_cvar_string("kniff_mode",kniffmode,4)
new kniffmode_bit = read_flags(kniffmode)
if (kniffmode_bit & 1) {
new killer_id = read_data(1)
new victim_id = read_data(2)
new killer_name, victim_name
get_user_name(killer_id,killer_name,33)
get_user_name(victim_id,victim_name,33)
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(0,kniffmessages[ random_num(0,KNIFFMESSAGES-1) ],killer_name,victim_name)
}
if (kniffmode_bit & 2) {
client_cmd(0,"spk misc/knife")
}
}
public roundend_msg(id)
alone_ann = 0
public death_msg(id){
new lmmode
get_cvar_string("lastman_mode",lmmode,8)
new lmmode_bit = read_flags(lmmode)
new players_ct, players_t, ict, ite, last
get_players(players_ct,ict,"ae","CT")
get_players(players_t,ite,"ae","TERRORIST")
if (ict==1&&ite==1){
new name1, name2
get_user_name(players_ct,name1,32)
get_user_name(players_t,name2,32)
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
if (lmmode_bit & 1){
if (lmmode_bit & 2){
show_hudmessage(0,"",name1,get_user_health(players_ct),name2,get_user_health(players_t))
}
else {
show_hudmessage(0,"",name1,name2)
}
if (lmmode_bit & 4){
client_cmd(0,"spk misc/one-one")
}
}
}
else {
if (ict==1&&ite>1&&alone_ann==0&&(lmmode_bit & 4)){
last=players_ct
client_cmd(last,"spk misc/wolf")
}
else if (ite==1&&ict>1&&alone_ann==0&&(lmmode_bit & 4)){
last=players_t
client_cmd(last,"spk misc/wolf")
}
else {
return PLUGIN_CONTINUE
}
alone_ann = last
new name
get_user_name(last,name,32)
if (lmmode_bit & 1){
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
if (lmmode_bit & 2){
show_hudmessage(0,messageshp[ random_num(0,MESSAGESHP-1) ],ite ,ict ,name,get_user_health(last))
}
else {
show_hudmessage(0,messagesnohp[ random_num(0,MESSAGESNOHP-1) ],ite ,ict ,name )
}
}
if (lmmode_bit & 4){
client_cmd(last,"spk misc/one-one")
}
}
return PLUGIN_CONTINUE
}
public hs(){
new hsmode
get_cvar_string("hs_mode",hsmode,4)
new hsmode_bit = read_flags(hsmode)
if (hsmode_bit & 1){
new killer_id = read_data(1)
new victim_id = read_data(2)
new victim_name
get_user_name(victim_id,victim_name,33)
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 3.0, 3.0, 0.15, 0.15, 1)
show_hudmessage(killer_id,"",victim_name)
}
if (hsmode_bit & 2){
client_cmd(0,"spk misc/covert3")
}
}
public plugin_precache(){
precache_sound( "djeyl/c4start.wav")//放C4声音
precache_sound( "djeyl/dead.wav")//手雷炸死声音
precache_sound( "djeyl/goal_1.wav")//拆C4声音
precache_sound( "misc/covert1.wav")//杀人声音
precache_sound( "misc/covert3.wav")// 爆头声音
precache_sound( "misc/covert4.wav")//杀人声音
precache_sound( "misc/covert5.wav")//杀人声音
precache_sound( "misc/covert8.wav")//杀人声音
precache_sound( "misc/head.wav")//杀人声音
precache_sound( "misc/knife.wav")//用刀杀人声音
precache_sound( "misc/one-one.wav")//双方只剩余1个人所有人听到的声音
precache_sound( "misc/wolf.wav")//双方只剩余1个人所有人听到的声音
return PLUGIN_CONTINUE
}
public plugin_init() {
register_plugin("UT 2003 All SoundsX","1.1","mcleoud84@hotmail.com")
register_event("DeathMsg","hs","a","3=1")
register_event("DeathMsg","knife_kill","a","4&kni")
register_event("DeathMsg","he_kills","a","4&gren")
register_event("StatusIcon", "got_bomb", "be", "1=1", "1=2", "2=c4")
register_event("SendAudio", "bomb_planted", "a", "2&%!MRAD_BOMBPL")
register_event("SendAudio", "bomb_defused", "a", "2&%!MRAD_BOMBDEF")
register_event("TextMsg", "bomb_failure", "a", "2&#Target_B")
register_event("BarTime", "bdef_g", "be", "1=10", "1=5","1=3")
register_event("BarTime", "bdef_l", "be", "1=0")
register_event("TextMsg", "bomb_pickup", "bc", "2&#Got_bomb")
register_event("TextMsg", "bomb_drop", "bc", "2&#Game_bomb_d")
register_event("SendAudio", "disable_c4", "a", "2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw")
register_event("TextMsg","disable_c4","a","2&#Game_C","2&#Game_w")
register_event("ResetHUD", "reset_hud", "b");
register_event("DeathMsg", "death_event", "a")
register_event("SendAudio","roundend_msg","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
register_event("TextMsg","roundend_msg","a","2&#Game_C","2&#Game_w")
register_event("DeathMsg","death_msg","a")
register_cvar("lastman_mode","abc")
register_cvar("streak_mode","ab")
register_cvar("bomb_mode","abcdefghi")
register_cvar("hekill_mode","abc")
register_cvar("kniff_mode","ab")
register_cvar("hs_mode","ab")
return PLUGIN_CONTINUE
} 好东西啊 学习了,谢谢 学习了,谢谢
页:
[1]