Ok i wrote it myself.
Its called pmstats.py you will also need an empty plugin_pmstats.xml
__version__ = '1.0.1'
__author__ = 'KnightOrk'
from b3 import clients
import b3, os, string, re, threading
import b3.events
import b3.plugin
class PmstatsPlugin(b3.plugin.Plugin):
_xlrstatsPlugin = None
def onStartup(self):
self.registerEvent(b3.events.EVT_GAME_ROUND_END)
self.registerEvent(b3.events.EVT_GAME_EXIT)
self._xlrstatsPlugin = self.console.getPlugin('xlrstats')
def onEvent(self, event):
if event.type == b3.events.EVT_GAME_ROUND_END or event.type == b3.events.EVT_GAME_EXIT:
self.show_stats()
def show_stats(self):
d= {}
for player in self.console.clients.getList():
if not d.has_key(player.name):
d[player.name] = [player.cid]
else:
d[player.name].append(player.cid)
for pname,cidlist in d.items():
if (len(pname) > 0):
for cid in cidlist:
client = self.console.clients.getByCID(cid)
stats = self._xlrstatsPlugin.get_PlayerStats(client)
if stats:
client.message( '^3XLR Stats: ^7%s ^7: K ^2%s ^7D ^3%s ^7TK ^1%s ^7Ratio ^5%1.02f ^7Skill ^3%1.02f' % (client.exactName, stats.kills, stats.deaths, stats.teamkills, stats.ratio, stats.skill))