请论坛的高手帮我把这个插件改成AMX 有代码
请论坛的高手帮我把这个插件改成AMX有代码 没有人帮忙吗??? 直接把源代码发上来 // AMX MOD X Plugin//
// Unreal Tournament Sounds X-MOD Plugin
//
// Coded By: -Firefox
//
// ------------------------------------------------------------------
// CVARs:
// ------------------------------------------------------------------
// ut_streak_mode - < flags >
//
// a - announce to all players by sound
// b - announce to all players by hud message
// c - announce to scorer by sound
// d - announce to scorer by hud message
// e - announce current death/killstreak at round start
//
// bomb_mode - < flags >
//
// a - exploded
// b - planting
// c - defusing
// d - planted
// e - defused
// f - failed to defuse
// g - pickup
// h - dropped
// i - sounds
//
// hekill_mode - < flags >
//
// a - show normal HE-Kill in hud
// b - show suicide HE-Kill in hud
// c - play sound on HE-Kill
//
// kniff_mode - < flags >
//
// a - messages
// b - sounds
//
// hs_mode - < flags >
//
// a - messages
// b - sounds
//
// lastman_mode - < flags >
//
// a - messages
// b - hp
// c - sounds
#include <amxmodx>
#include <amxmod>
#define Maxsounds 1
#define LEVELS 14
#define KNIFFMESSAGES 4
#define HEMESSAGES 4
#define HESMESSAGES 4
#define MESSAGESHP 4
#define MESSAGESNOHP 4
new kills = {0,...};
new deaths = {0,...};
new planter
new defuser
new c4timer
new defusing
new Float:last_omg
new Float:last_plan
new alone_ann = 0
new levels = {2,3,4,5,7,9,10,12,13,14,16,18,20,21};
new sounds[] = {
"misc/doublekill",
"misc/tripplekill2003",
"misc/multikill",
"misc/killingspree",
"misc/rampage",
"misc/mmmmonster",
"misc/megakill",
"misc/dominating",
"misc/ultrakill",
"misc/unstoppable",
"misc/ludicrouskill",
"misc/wickedsick",
"misc/godlike",
"misc/holyshit"
};
new messages[] = {
"%s 璇?: 鎴戞潃浜嗕袱涓簡!!!",
"%s 璇?: 鎴戜笉鏁㈢浉淇″凡鏉€浜嗕笁涓?!!",
"%s 璇?: 娌¢敊 鏄殑 鎴戞潃浜嗗お澶氫簡 杩欐槸浜嬪疄!!!",
"%s 璇?: 鏉€鐨勭湡鐖?!!",
"鎴慤Fo瀵?%s 璇? 鍝﹀枖鍣?浣犲おcool浜?!!",
"%s: 鏉€姝讳簡鍙?鎬?鎬?鎬?鎬墿!!!",
"%s 璇?: 鎴戞潃鐨勫お澶氫簡锛?,
"%s 鐤媯鍦板惣鍒?: 鎴戞槸缁熸不鑰?!!",
"%s: 鏉€鐤簡!!!",
"%s 璇?: 娌¢敊杩欐槸鏃犳硶鍋滄鐨?!!",
"%s 璇?: 鍣㈠摝锛屾垜鐜板湪鐪熸兂鍠濅竴缃愬啺姘旀按!!!",
"琚?%s 鏉€浜嗙殑浜哄 %s 璇? 浣犺繖涓伓妫?!!",
"%s 璇?: 涓婂笣鍟?!!",
"%s: 浣犺嚜宸盪!!!"
};
new kniffmessages[] = {
"%s 灏?%s 鍒囨垚浜嗗潡鐘?,
"%s 鎶涘嚭鍒€锛岀┛鍚?%s 鍐呰剰 鍝﹀枖 鎴戣鍚愪簡",
" 鍢?%s 褰撳績鍚庨潰楝艰吹绁熺鐨勪汉鍜屽垁 ",
" 鍛曪紝%s 琚?%s 鐢ㄥ垁鏉€浜?"}
new he_messages[] = {
"%s 缁?%s 閫佸嚭涓€涓皬绀肩墿 ",
"%s 鎵旂粰 %s 涓€涓ぜ鐗?",
"%s 鎵斾簡鐡舵皵姘寸粰 %s 鍒堕€犱簡涓€涓垎鐐?",
"%s 浣?%s 寰楀埌涓€涓ぇ鐖嗙偢 "}
new hes_messages[] = {
"%s 浠栫敤姹芥按鐖嗕簡浠栬嚜宸?,
" 鍢?%s 鍝﹀櫌鍣紝鐪嬬湅绾㈤浄鐨勬晥鏋滃惂",
" 鍟婂搱鍝堝搱 %s 浠栫敤绾㈤浄鐐告帀浜嗕粬鑷繁鐨勫眮鑲?,
"%s 鏀句簡涓眮鐐告帀浜嗕粬鐨勫眮鑲?"}
new messagesnohp[] = {
"%i terrorist vs %i CT^n%s: 鐜板湪锛屼綘浠墍鏈変汉鐨勫笇鏈涢兘闈犱綘浜嗭紝涓婂笣鐩镐俊浣狅紝鍔犳补!锛?,
"%i terrorist vs %i CT^n%s: 鎴戜竴鐩村笇鏈涗綘鏈変竴涓鍖?",
"%i terrorist vs %i CT^n%s: 浣犵殑鎵€鏈夐槦鍙嬮兘姝讳簡锛岀浣犲ソ杩?",
"%i terrorist vs %i CT^n%s: 鐜板湪鍙墿浣犱竴涓簡锛屽紑蹇冪偣鍚у瀛愶紝澶у閮藉湪鐪嬭繖浣?骞朵笖鎴戜竴鐩寸浉淇′綘 My hero come on, GO!"}
new messageshp[] = {
"%i terrorist vs %i CT^n%s (%i hp): 鐜板湪锛屼綘浠墍鏈変汉鐨勫笇鏈涢兘闈犱綘浜嗭紝涓婂笣鐩镐俊浣狅紝鍔犳补!!",
"%i terrorist vs %i CT^n%s (%i hp): 鎴戜竴鐩村笇鏈涗綘鏈変竴涓鍖?",
"%i terrorist vs %i CT^n%s (%i hp): 浣犵殑鎵€鏈夐槦鍙嬮兘姝讳簡锛岀浣犲ソ杩?",
"%i terrorist vs %i CT^n%s (%i hp): 鐜板湪鍙墿浣犱竴涓簡锛屽紑蹇冪偣鍚у瀛愶紝澶у閮藉湪鐪嬭繖浣?骞朵笖鎴戜竴鐩寸浉淇′綘 My hero come on, GO!!"}
is_mode_set(bits) {
new mode;
get_cvar_string("ut_streak_mode", mode, 8);
return read_flags(mode) & bits;
}
get_bemode() {
new bemode
get_cvar_string("bomb_mode",bemode,9)
return read_flags(bemode)
}
public death_event(id) {
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 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);
if (is_mode_set(2)) {
show_hudmessage(0, messages, name);
} else if (is_mode_set(8)) {
show_hudmessage(killer, messages, name);
}
if (is_mode_set(1)) {
client_cmd(0, "spk %s", sounds);
} else if (is_mode_set(4)) {
client_cmd(killer, "spk %s", sounds);
}
}
public reset_hud(id) {
if (is_mode_set(16)) {
if (kills > levels) {
client_print(id, print_chat,
"* 浣犳潃鐨勫彲鐪熷揩鍟?%d涓汉 浣犳潃浜?",
kills);
} else if (deaths > 1) {
client_print(id, print_chat,
"* T褰撳績浣犳鐨勫ソ蹇?%d娆?浣犳浜?",
deaths);
}
}
}
public client_connect(id) {
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,"鍝﹁€? %s 鍒拌揪闆峰尯浜?",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,"%s 姝e湪甯冮浄!",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,"%s 姝e湪瑙i浄锛宑ome on蹇偣鎴戠殑鑻遍泟 :D",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/c4powa")
}
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,"%s 璇?鎴戜滑甯冧笅浜嗛浄鍖?CT瑕佸€掗湁浜?!!",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/laugh")
}
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,"%s 瑙f帀浜嗛浄鍖咃紝浠栬OH鎴戠湡鎯冲枬鐡跺啺姘旀按!",name)
disable_c4()
}
}
public bomb_failure(){
new bemode = get_bemode()
if (defuser){
if (bemode&256){
client_cmd(0,"spk djeyl/witch")
}
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,"%s瑙i浄澶辫触...come on boy浣犲凡缁忓敖鍔?,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,"%s 妫€璧蜂簡闆峰寘...",name)
}
}
public bomb_drop(){
new bemode = get_bemode()
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," OH shit %s 鎵旀帀闆峰寘閫冭窇浜?!!",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/grenade")
}
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/witch")
}
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/humiliation")
}
}
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,"%s (%i hp) vs. %s (%i hp)",name1,get_user_health(players_ct),name2,get_user_health(players_t))
}
else {
show_hudmessage(0,"%s vs. %s",name1,name2)
}
if (lmmode_bit & 4){
client_cmd(0,"spk misc/maytheforce")
}
}
}
else {
if (ict==1&&ite>1&&alone_ann==0&&(lmmode_bit & 4)){
last=players_ct
client_cmd(last,"spk misc/oneandonly")
}
else if (ite==1&&ict>1&&alone_ann==0&&(lmmode_bit & 4)){
last=players_t
client_cmd(last,"spk misc/oneandonly")
}
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/maytheforce")
}
}
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,"::HEAD鐖嗗ごSHOT:: 鍝?%s 浣犵殑澶磋鍒汉褰撳仛瑗跨摐缁欑垎浜?!!",victim_name)
}
if (hsmode_bit & 2){
client_cmd(0,"spk misc/headshot")
}
}
new soundlist[] = {"misc/connect"}
public client_putinserver(id) {
new Userid
Userid = id
set_task(1.0,"consound",0,Userid,1)
return PLUGIN_CONTINUE
}
public consound(id[]){
new i, Usertime
Usertime = get_user_time(id, 0)
if (Usertime <= 0){
set_task(1.0,"consound",0,id,1)
}else{
i = random_num(0,Maxsounds-1)
client_cmd(id,"spk %s",soundlist)
}
return PLUGIN_CONTINUE
}
public plugin_precache(){
new a
for(a = 0; a < Maxsounds; ++a){
new msg
format(msg,127,"%s.wav", soundlist)
precache_sound( msg )
precache_sound( "misc/mmmmonster.wav")
precache_sound( "misc/godlike.wav")
precache_sound( "misc/dominating.wav")
precache_sound( "misc/doublekill.wav")
precache_sound( "misc/holyshit.wav")
precache_sound( "misc/wickedsick.wav")
precache_sound( "misc/rampage.wav")
precache_sound( "misc/tripplekill2003.wav")
precache_sound( "misc/unstoppable.wav")
precache_sound( "misc/ludicrouskill.wav")
precache_sound( "misc/megakill.wav")
precache_sound( "misc/killingspree.wav")
precache_sound( "misc/multikill.wav")
precache_sound( "misc/ultrakill.wav")
precache_sound( "misc/maytheforce.wav")
precache_sound( "misc/oneandonly.wav")
precache_sound( "misc/headshot.wav")
precache_sound( "djeyl/c4powa.wav")
precache_sound( "djeyl/laugh.wav")
precache_sound( "djeyl/grenade.wav")
precache_sound( "djeyl/witch.wav")
}
return PLUGIN_CONTINUE
}
public plugin_init() {
register_plugin("UT Sounds X", "1.5", "鐢盪Fo姹夊寲");
register_cvar("ut_streak_mode", "cde");
register_event("ResetHUD", "reset_hud", "b");
register_event("DeathMsg", "death_event", "a");
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("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("bomb_mode","abcdefghi")
register_cvar("hekill_mode","abc")
register_cvar("kniff_mode","ab")
register_cvar("hs_mode","ab")
return PLUGIN_CONTINUE;
} 代码太长了。。 分2次发完 http://www.dt-club.net/forum/redirect.php?tid=43525&goto=lastpost#lastpost
页:
[1]