|
发表于 2010-7-31 04:59:35
|
显示全部楼层
来自 中国–浙江–嘉兴–海宁市
include <amxmod>
#define KNIFFMESSAGES 4
#define HEMESSAGES 4 /* Number of Random Messages for Normal HE Kills */
#define HESMESSAGES 4 /* 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[33] = {0,...};
new deaths[33] = {0,...};
new alone_ann = 0
new levels[15] = {1, 2, 3, 4, 5, 7, 9, 10, 12, 13, 14, 16, 18, 20, 21};
new stksounds[15][] = {"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[15][] = {"", "", "", "", "",
"", "", "", "", "",
"", "", "", "", ""};
new kniffmessages[KNIFFMESSAGES][] = {
"",
"",
"",
""}
new he_messages[HEMESSAGES][] = {
"",
"",
"",
""} /* Random Messages for Normal HE Kills */
new hes_messages[HESMESSAGES][] = {
"",
"",
"",
""} /* Random Messages for Suicide HE Kills */
new messagesnohp[MESSAGESNOHP][] = {"",
"",
"",
""}
new messageshp[MESSAGESHP][] = {"",
"",
"",
""}
get_streak() {
new streak[3]
get_cvar_string("streak_mode",streak,2)
return read_flags(streak)
}
get_bemode() {
new bemode[10]
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[killer] += 1;
kills[victim] = 0;
deaths[killer] = 0;
deaths[victim] += 1;
for (new i = 0; i < LEVELS; i++) {
if (kills[killer] == levels[i]) {
announce(killer, i);
return PLUGIN_CONTINUE;
}
}
}
return PLUGIN_CONTINUE;
}
announce(killer, level) {
new streak = get_streak()
if (streak&1){
new name[32];
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[level], name);
}
if (streak&2){
client_cmd(0, "spk %s", stksounds[level]);
}
}
public reset_hud(id) {
new streak = get_streak()
if (streak&1){
if (kills[id] > levels[0]) {
client_print(id, print_chat,
"", kills[id]);
} else if (deaths[id] > 1) {
client_print(id, print_chat,
"", deaths[id]);
}
}
}
public client_connect(id) {
new streak = get_streak()
if ((streak&1) || (streak&2)){
kills[id] = 0;
deaths[id] = 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[32], numte
get_players(bplayers_t,numte,"e","TERRORIST")
last_omg = get_gametime() + 15.0
new name[32]
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[0],"",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[32], numte
get_players(bplayers_t,numte,"e","TERRORIST")
last_plan = get_gametime() + 15.0
new name[32]
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[0],"",name)
}
}
}
else {
defuser = defusing = id
if (last_plan < get_gametime()){
if (bemode&4){
new bplayers_ct[32], numct
get_players(bplayers_ct,numct,"e","CT")
last_plan = get_gametime() + 15.0
new name[32]
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[0],"",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[32]
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[48]
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[48]
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[32]
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[32]
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[32], numte
get_players(bplayers_t,numte,"e","TERRORIST")
new name[32]
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[0],"",name)
}
}
public bomb_drop(){
new bemode = get_bemode()
client_cmd(0,"spk vox/woop")
if (bemode&128){
new bplayers_t[32], numte
get_players(bplayers_t,numte,"e","TERRORIST")
new name[32]
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[0],"",name)
}
}
public he_kills(){
new killer_id = read_data(1)
new victim_id = read_data(2)
new killer_name[32], victim_name[33]
get_user_name(killer_id,killer_name,33)
get_user_name(victim_id,victim_name,33)
new hekmode[8]
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)
}
}
} |
|