|
楼主 |
发表于 2010-8-19 19:59:17
|
显示全部楼层
来自 中国–河北–衡水–冀州区
if ( EndMostDamage ) {
new damage = 0, who = 0, hits = 0
for(new i = 0; i < pnum; ++i){
get_user_rstats( players[i],stats, bodyhits )
if ( stats[6] > damage ){
who = players[i]
hits = stats[5]
damage = stats[6]
}
}
if ( is_user_connected(who) ) {
new name[32]
get_user_name( who, name, 31 )
len += format(g_Buffer[len] , 512 - len ,
"_________________________________^n最具杀伤力: %s^n击中敌人%d 次/造成 %d 伤害^n", name , hits , damage)
}
}
if ( EndTeamScore )
format(g_Buffer[len] , 512 - len , "_________________________________^n匪徒%d次胜利-- 警察%d次胜利^n", g_teamScore[0] , g_teamScore[1] )
set_hudmessage(128,128,255,-1.0,0.70,2, 0.01, 5.0, 0.01, 0.01, 3 )
show_hudmessage( 0 , g_Buffer )
}
}
public cmdKiller(id) {
if ( !SayHP ){
client_print(id,print_chat, g_disabledMsg )
return PLUGIN_HANDLED
}
if (g_Killers[id][0]) {
new name[32], stats[8], body[8], wpn[33], mstats[8], mbody[8]
get_user_name(g_Killers[id][0],name,31)
get_user_astats(id,g_Killers[id][0],stats,body,wpn,31)
client_print(id,print_chat,"%s 使用 %s 在 %.2f米外将你结束了", name,wpn,float(g_Killers[id][3]) * 0.0254 )
client_print(id,print_chat,"他击中你%d 枪,对你造成 %d 点伤害,并且他还有 %d生命和 %d护甲",
stats[5],stats[6], g_Killers[id][1],g_Killers[id][2] )
if ( get_user_vstats(id,g_Killers[id][0],mstats,mbody) ) {
client_print(id,print_chat,"你击中他 %d 枪,对他造成 %d 伤害",mstats[5], mstats[6])
getMyHits(id,g_Killers[id][0])
client_print(id,print_chat,g_Buffer)
}
else client_print(id,print_chat,"你没打着他..")
}
else {
client_print(id,print_chat,"你还没有被杀...")
}
return PLUGIN_CONTINUE
}
public cmdStatsMe(id){
if ( !SayStatsMe ){
client_print(id,print_chat, g_disabledMsg )
return PLUGIN_HANDLED
}
displayStats(id,id)
return PLUGIN_CONTINUE
}
public displayStats(id,dest) {
new pos, name[32], stats[8], body[8]
get_user_wstats(id,0,stats,body)
#if !defined NO_STEAM
new szszState[4]
pos += copy(g_Buffer[pos],2047-pos,"<meta charset=UTF-8><style>body{font-family:Arial,sans-serif;font-size:12px;color:#FFCC99;background-color:#000000;margin-left:8px;margin-top:3px}.header{background-color:#9C0000;}.one{background-color:#310000;}.two{background-color:#630000;}")
pos += format(g_Buffer[pos],2047-pos,"</style></head><body><table><tr class=^"one^"><td>杀敌:</td><td>%d</td></tr><tr class=^"two^"><td>被杀:</td><td>%d</td></tr><tr class=^"one^"><td>爆头(率):</td><td>%d (%0.1f%)</td></tr><tr class=^"two^"><td>伤害:</td><td>%d</td></tr><tr class=^"one^"><td>击中:</td><td>%d</td></tr><tr class=^"one^"><td>开枪:</td><td>%d</td></tr></table><br><br>",
stats[0],stats[1],stats[2],100 * float( stats[2])/float( stats[0]),stats[6],stats[5],stats[4])
pos += copy(g_Buffer[pos],2047-pos,"<table><tr class=^"header^"><td>武器</td><td>开枪</td><td>击中</td><td>伤害</td><td>杀敌</td><td>死亡</td></tr>")
for(new a = 1; a < 31; ++a) {
if (get_user_wstats(id,a,stats,body)) {
if (equal(szszState,"one")) copy(szszState,3,"two")
else copy(szszState,3,"one")
get_weaponname(a,name,31)
pos += format(g_Buffer[pos],2047-pos,"<tr class=^"%s^"><td>%s</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td></tr>",
szszState,name[7],stats[4],stats[5],stats[6],stats[0],stats[1])
}
}
copy(g_Buffer[pos],2047-pos,"</table></body></html>")
#else
pos = format(g_Buffer,2047,"%6s: %d^n%6s: %d^n%6s: %d^n%6s: %d^n%6s: %d^n^n",
"杀敌",stats[0],"被杀",stats[1],"伤害",stats[6],"击中",stats[5],"开枪",stats[4])
pos += format(g_Buffer[pos],2047-pos, "%-12.11s %6s %6s %6s %6s %6s^n",
"weapon","shots","hits","damage","kills","deaths")
for(new a = 1; a < 31; ++a) {
if (get_user_wstats(id,a,stats,body)){
get_weaponname(a,name,31)
pos += format(g_Buffer[pos],2047-pos,"%-12.11s %6d %6d %6d %6d %6d^n",
name[7],stats[4],stats[5],stats[6],stats[0],stats[1])
}
}
#endif
get_user_name(id,name,31)
show_motd(dest,g_Buffer,name)
return PLUGIN_CONTINUE
}
public cmdRank(id){
if ( !SayRank ){
client_print(id,print_chat, g_disabledMsg )
return PLUGIN_HANDLED
}
displayRank(id,id)
return PLUGIN_CONTINUE
}
displayRank(id,dest) {
new pos, name[32], stats[8], body[8]
new rank_pos = get_user_stats(id,stats,body)
#if !defined NO_STEAM
pos += copy(g_Buffer[pos],2047-pos,"<meta charset=UTF-8><style>body{font-family:Arial,sans-serif;font-size:12px;color:#FFCC99;background-color:#000000;margin-left:8px;margin-top:3px}.header{background-color:#9C0000;}.one{background-color:#310000;}.two{background-color:#630000;}")
pos += format(g_Buffer[pos],2047-pos,"</style></head><body><table><tr><td colspan=2>%s在%d人中排名第%d</td></tr>",(id==dest)?"你的":"他的",get_statsnum(), rank_pos)
pos += format(g_Buffer[pos],2047-pos,"<tr class=^"one^"><td>杀敌:</td><td>%d</td></tr><tr class=^"two^"><td>死亡:</td><td>%d</td></tr><tr class=^"one^"><td>爆头(率):</td><td>%d (%0.1f%)</td></tr><tr class=^"two^"><td>伤害:</td><td>%d</td></tr><tr class=^"one^"><td>击中:</td><td>%d</td></tr><tr class=^"two^"><td>开枪:</td><td>%d</td></tr><tr><td> </td><td> </td></tr>",
stats[0],stats[1],stats[2],100 * float( stats[2])/float( stats[0]),stats[6],stats[5],stats[4])
pos += format(g_Buffer[pos],2047-pos,"<tr class=^"header^"><td colspan=2>击中</td></tr><tr class=^"one^"><td>%s:</td><td>%d</td></tr><tr class=^"two^"><td>%s:</td><td>%d</td></tr><tr class=^"one^"><td>%s:</td><td>%d</td></tr><tr class=^"two^"><td>%s:</td><td>%d</td></tr><tr class=^"one^"><td>%s:</td><td>%d</td></tr><tr class=^"two^"><td>%s:</td><td>%d</td></tr><tr class=^"one^"><td>%s:</td><td>%d</td></tr>",
g_bodyParts[1],body[1],g_bodyParts[2],body[2],g_bodyParts[3],body[3], g_bodyParts[4],body[4],
g_bodyParts[5],body[5],g_bodyParts[6],body[6],g_bodyParts[7],body[7])
copy(g_Buffer[pos],2047-pos,"</table></body></html>")
#endif
get_user_name(id,name,31)
show_motd(dest,g_Buffer,name)
}
public cmdTop15(id) {
if ( !SayTop15 ){
client_print(id,print_chat, g_disabledMsg )
return PLUGIN_HANDLED
}
getTop15()
show_motd(id,g_Buffer,"Top 15")
return PLUGIN_CONTINUE
}
public endGameStats(){
if ( EndPlayer ){
new players[32], inum
get_players(players,inum)
for(new i = 0; i < inum; ++i)
displayStats(players[i],players[i])
}
else if ( EndTop15 ) {
new players[32], inum
get_players(players,inum)
getTop15()
for(new i = 0; i < inum; ++i)
show_motd(players[i],g_Buffer,"Top 15")
}
}
public eInterMission()
set_task(1.0,"endGameStats")
public cmdStats(id){
if ( !SayStatsAll ){
client_print(id,print_chat, g_disabledMsg )
return PLUGIN_HANDLED
}
showStatsMenu(id,g_userPosition[id]=0)
return PLUGIN_CONTINUE
}
public actionStatsMenu(id,key){
switch(key){
case 7: {
g_userszszState[id] = 1 - g_userszszState[id]
showStatsMenu(id,g_userPosition[id])
}
case 8: showStatsMenu(id,++g_userPosition[id])
case 9: showStatsMenu(id,--g_userPosition[id])
default:{
new option = g_userPosition[id] * 7 + key
new index = g_userPlayers[id][option]
if (is_user_connected(index)){
if (g_userszszState[id])
displayRank(index,id)
else
displayStats(index,id)
}
showStatsMenu(id,g_userPosition[id])
}
}
return PLUGIN_HANDLED
}
showStatsMenu(id,pos){
if (pos < 0) return PLUGIN_HANDLED
new menu_body[512], inum, k = 0, start = pos * 7
get_players(g_userPlayers[id],inum)
if (start >= inum) start = pos = g_userPosition[id] = 0
new len = format(menu_body,511,"\y在线玩家数据查询\R%d/%d^n\w^n",pos + 1,((inum/7)+((inum%7)?1:0)))
new name[32], end = start + 7, keys = (1<<9)|(1<<7)
if (end > inum) end = inum
for(new a = start; a < end; ++a){
get_user_name(g_userPlayers[id][a],name,31)
keys |= (1<<k)
len += format(menu_body[len],511-len,"%d. %s^n\w",++k,name)
}
len += format(menu_body[len],511-len,"^n8. %s^n\w",g_userszszState[id] ? "Show rank" : "Show stats" )
if (end != inum){
format(menu_body[len],511-len,"^n9. More...^n0. %s" , pos ? "Back" : "Exit" )
keys |= (1<<8)
}
else format(menu_body[len],511-len,"^n0. %s" , pos ? "Back" : "Exit" )
show_menu(id,keys,menu_body)
return PLUGIN_HANDLED
} |
|