diff --git a/plugins/stats.sma b/plugins/stats.sma index edae8a29..ea0d9d62 100755 --- a/plugins/stats.sma +++ b/plugins/stats.sma @@ -177,12 +177,25 @@ getHits(id,killer) { } /* get top 15 */ -getTop15(){ - new pos=0, stats[8], body[8], name[32] +getTop15() { + new pos, stats[8], body[8], name[32] #if !defined NO_STEAM - pos = format(g_Buffer,2047,"
")
-#endif
-  pos += format(g_Buffer[pos],2047-pos," #  %-28.27s %6s %6s %6s %6s %6s^n",
+  new state[4]
+  pos = copy(g_Buffer,2047,"")
+
+  new imax = get_statsnum()
+  if (imax > 15) imax = 15
+  for(new a = 0; a < imax; ++a){
+    if (equal(state,"one")) copy(state,3,"two")
+    else copy(state,3,"one")
+    get_stats(a,stats,body,name,31)
+    pos += format(g_Buffer[pos],2047-pos,"",state,a+1,name,stats[0],stats[1],stats[5],stats[4],stats[2])
+  }
+  copy(g_Buffer[pos],2047-pos,"
#NickKillsDeathsHitsShotsHS
%d.%s%d%d%d%d%d
") +#else + pos = format(g_Buffer,2047," # %-28.27s %6s %6s %6s %6s %6s^n", "nick", "kills" , "deaths" , "hits","shots","hs" ) new imax = get_statsnum() if (imax > 15) imax = 15 @@ -190,8 +203,6 @@ getTop15(){ get_stats(a,stats,body,name,31) pos += format(g_Buffer[pos],2047-pos,"%2d. %-28.27s %6d %6d %6d %6d %6d^n",a+1,name,stats[0],stats[1],stats[5],stats[4],stats[2]) } -#if !defined NO_STEAM - format(g_Buffer[pos],2047-pos,"
") #endif } @@ -292,7 +303,7 @@ public eRoundEndTask() { hs , (hs == 1) ? "": "s" ) } } - if ( EndMostDamage ){ + if ( EndMostDamage ) { new damage = 0, who = 0, hits = 0 for(new i = 0; i < pnum; ++i){ get_user_rstats( players[i],stats, bodyhits ) @@ -351,12 +362,27 @@ public cmdStatsMe(id){ } public displayStats(id,dest) { - new pos=0, name[32], stats[8], body[8] + new pos, name[32], stats[8], body[8] get_user_wstats(id,0,stats,body) #if !defined NO_STEAM - pos = format(g_Buffer,2047,"
")
-#endif
-  pos += format(g_Buffer[pos],2047-pos,"%6s: %d^n%6s: %d^n%6s: %d^n%6s: %d^n%6s: %d^n^n",
+  new state[4]
+  pos = copy(g_Buffer,2047,"
Kills:%d
Deaths:%d
Damage:%d
Hits:%d
Shots:%d


", + stats[0],stats[1],stats[6],stats[5],stats[4]) + pos += copy(g_Buffer[pos],2047-pos,"") + for(new a = 1; a < 31; ++a) { + if (get_user_wstats(id,a,stats,body)) { + if (equal(state,"one")) copy(state,3,"two") + else copy(state,3,"one") + get_weaponname(a,name,31) + pos += format(g_Buffer[pos],2047-pos,"", + name[7],stats[4],stats[5],stats[6],stats[0],stats[1]) + } + } + copy(g_Buffer[pos],2047-pos,"
WeaponShotsHitsDamageKillsdeaths
%s%d%d%d%d%d
") +#else + pos = format(g_Buffer,2047,"%6s: %d^n%6s: %d^n%6s: %d^n%6s: %d^n%6s: %d^n^n", "Kills",stats[0],"Deaths",stats[1],"Damage",stats[6],"Hits",stats[5],"Shots",stats[4]) pos += format(g_Buffer[pos],2047-pos, "%-12.11s %6s %6s %6s %6s %6s^n", "weapon","shots","hits","damage","kills","deaths") @@ -367,10 +393,8 @@ public displayStats(id,dest) { name[7],stats[4],stats[5],stats[6],stats[0],stats[1]) } } - get_user_name(id,name,31) -#if !defined NO_STEAM - format(g_Buffer[pos],2047-pos,"
") #endif + get_user_name(id,name,31) show_motd(dest,g_Buffer,name) return PLUGIN_CONTINUE } @@ -385,19 +409,25 @@ public cmdRank(id){ } displayRank(id,dest) { - new pos=0, name[32], stats[8], body[8] + new pos, name[32], stats[8], body[8] new rank_pos = get_user_stats(id,stats,body) #if !defined NO_STEAM - pos = format(g_Buffer,2047,"
")
-#endif
-  pos += format(g_Buffer[pos],2047-pos,"%s rank is %d of %d^n^n",(id==dest)?"Your":"His", rank_pos,get_statsnum())
+  pos = copy(g_Buffer,2047,"",(id==dest)?"Your":"His", rank_pos,get_statsnum())
+  pos += format(g_Buffer[pos],2047-pos,"",
+    stats[0],stats[1],stats[6],stats[5],stats[4])
+  pos += format(g_Buffer[pos],2047-pos,"",
+    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,2047,"
%s rank is %d of %d
Kills:%d
Deaths:%d
Damage:%d
Hits:%d
Shots:%d
  
Hits
%s:%d
%s:%d
%s:%d
%s:%d
%s:%d
%s:%d
%s:%d
") +#else + pos = format(g_Buffer,2047,"%s rank is %d of %d^n^n",(id==dest)?"Your":"His", rank_pos,get_statsnum()) pos += format(g_Buffer[pos],2047-pos,"%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d^n^n", "Kills",stats[0],"Deaths",stats[1],"Damage",stats[6],"Hits",stats[5],"Shots",stats[4]) pos += format(g_Buffer[pos],2047-pos,"%10s:^n%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d", "Hits",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]) -#if !defined NO_STEAM - format(g_Buffer[pos],2047-pos,"
") #endif get_user_name(id,name,31) show_motd(dest,g_Buffer,name) @@ -485,4 +515,4 @@ showStatsMenu(id,pos){ else format(menu_body[len],511-len,"^n0. %s" , pos ? "Back" : "Exit" ) show_menu(id,keys,menu_body) return PLUGIN_HANDLED -} +} \ No newline at end of file