|
/* build list of attackers */
getAttackers(id) {
new name[32],t_sWpn[32], stats[8],body[8],found=0
new pos = copy(g_Buffer,2047,"攻击者:^n")
new amax = get_maxplayers()
for(new a = 1; a <= amax; ++a){
if(get_user_astats(id,a,stats,body,t_sWpn,31)){
found = 1
if (stats[0])
format(t_sWpn,31," - %s",t_sWpn)
else
t_sWpn[0] = 0
get_user_name(a,name,31)
pos += format(g_Buffer[pos],2047-pos,"%s -- 击中 %d次/ %d点伤害%s^n",name,stats[5],stats[6],t_sWpn)
}
}
return found
}
/* save hits and damage */
public eCSDeathMsg() {
new killer = read_data(1)
new victim = read_data(2)
if ( killer == victim ) return
new vorigin[3], korigin[3]
get_user_origin(victim,vorigin)
get_user_origin(killer,korigin)
g_Killers[victim][0] = killer
g_Killers[victim][1] = get_user_health(killer)
g_Killers[victim][2] = get_user_armor(killer)
g_Killers[victim][3] = get_distance(vorigin,korigin)
if ( ShowKiller ){
new name[32], stats[8], body[8], t_sWpn[33], mstats[8], mbody[8]
get_user_name(killer,name,31)
get_user_astats(victim,killer,stats,body,t_sWpn,31)
if ( !get_user_vstats(victim,killer,mstats,mbody) )
mstats[5] = mstats[6] = 0
set_hudmessage(220,80,0,0.05,0.15,0, 6.0, 12.0, 1.0, 2.0, 1)
getHits(victim,killer)
show_hudmessage(victim,"%s 用 %s 将你击毙^n距离你 %.2f 米.^n他对你造成 %d 的伤害,打中你 %d 次^n他还有 %d生命值 和 %d护甲.^n你对他造成了 %d 的伤害, 击中他 %d次.^n他击中了你下列部位:^n%s",
name,t_sWpn,float(g_Killers[victim][3]) * 0.0254, stats[6],stats[5], g_Killers[victim][1],g_Killers[victim][2],
mstats[6],mstats[5],g_Buffer )
}
if ( ShowVictims && getVictims(victim) ){
set_hudmessage(0,80,220,0.55,0.60,0, 6.0, 12.0, 1.0, 2.0, 4)
show_hudmessage(victim,g_Buffer)
}
if ( ShowAttackers && getAttackers(victim)){
set_hudmessage(220,80,0,0.55,0.35,0, 6.0, 12.0, 1.0, 2.0, 3)
show_hudmessage(victim,g_Buffer)
}
if ( KillerHpAp ){
new name[32], kmsg[128]
get_user_name(killer,name,31)
format(kmsg,127,"%s 还有 %d生命值 和 %d护甲",name,g_Killers[victim][1],g_Killers[victim][2])
client_print(victim,print_console,kmsg)
set_hudmessage(255,255,255,0.02,0.85,2, 1.5, 3.0, 0.02, 5.0, 1)
show_hudmessage(victim,kmsg)
}
} |
|