コード例 #1
0
ファイル: standard.py プロジェクト: laiello/extendedstats
def load():
    extendedstats.registerMethod(packagename,'kdr',KDR)
    extendedstats.registerMethod(packagename,'kills',PureKills)
    extendedstats.registerMethod(packagename,'deaths',PureDeaths)
    extendedstats.registerMethod(packagename,'team_kdr',tKDR)
    extendedstats.registerMethod(packagename,'killsperminute',kpm)
    if extendedstats.addonIsLoaded('extendedevents') and extendedstats.game == 'cstrike':
        extendedstats.registerMethod(packagename,'money',money)
        extendedstats.registerMethod(packagename,'score',score)
    extendedstats.registerMethod(packagename,'damage',damage)
コード例 #2
0
# ExtendedEvents eXtended Stats Addon version 2.0 by Ojii
# Compatible with ExtendedEvents 4

from extendedstats import extendedstats
import es, vecmath, path

EE = extendedstats.addonIsLoaded('extendedevents')
if EE:
    columns = [
        ('jump_distance','REAL DEFAULT 0.0'),
        ('jump_longest','INTEGER DEFAULT 0'),
    ]
    if extendedstats.game == 'cstrike':
        columns += [('money','INTEGER DEFAULT 0')]
    wcolumns = None
    if extendedstats.game == 'dod':
        columns += [('dod_captures','INTEGER DEFAULT 0')]
    elif extendedstats.game == 'cstrike':
        wcolumns = map(lambda x: ('bought_%s' % x,'INTEGER DEFAULT 0'),extendedstats.cstrike_weapons)
        extendedstats.players.addColumns(wcolumns)
        extendedstats.weapons.addColumns([('bought','INTEGER DEFAULT 0')])
    extendedstats.players.addColumns(columns)
    
def load():
    if EE:
        extendedstats.loadEvents('extendedevents')
    else:
        extendedstats.dbg('XSEE: No extendedevents found')
コード例 #3
0
ファイル: strange.py プロジェクト: laiello/extendedstats
def load():
    if extendedstats.addonIsLoaded('extendedevents'):
        extendedstats.registerMethod(packagename,'jumpdistance',jumpdistance)
        extendedstats.registerMethod(packagename,'longestjump',longestjump)
    extendedstats.registerMethod(packagename,'falldamage',falldamage)
コード例 #4
0
ファイル: weaponstats.py プロジェクト: laiello/extendedstats
# 1.6
import es,popuplib
from extendedstats import extendedstats as xs

weapons = xs.weapons
players = xs.players
scfg = xs.scfg
EE = xs.addonIsLoaded('extendedevents')

def load():
    xs.registerCommand(scfg.command_weaponstats_weaponstats,'weaponstats',cmd_weaponstats,True,True)
    xs.registerCommand(scfg.command_weaponstats_myweaponstats,'weaponstats',cmd_myweaponstats,True,True)
    pplchck('xs_ws_list')
    p = popuplib.easymenu('xs_ws_list','_popup_choice',weaponstats)
    pp = popuplib.easymenu('xs_ws_mylist','_popup_choice',myweaponstats)
    weapons.execute("SELECT weapon FROM xs_weapons ORDER BY weapon ASC")
    for weapon in weapons.fetchall():
        p.addoption(weapon,weapon)
        pp.addoption(weapon,weapon)
    
def cmd_weaponstats(userid,args):
    pplchck('xs_ws_%s' % userid)
    weapons.execute("SELECT weapon,kills FROM xs_weapons ORDER BY kills DESC LIMIT 1")
    top = weapons.fetchone()
    weapons.execute("SELECT weapon,damage FROM xs_weapons ORDER BY damage DESC LIMIT 1")
    pain = weapons.fetchone()
    weapons.execute("SELECT weapon,damage FROM xs_weapons ORDER BY damage ASC LIMIT 1")
    pacifist = weapons.fetchone()
    if EE:
        weapons.execute("SELECT weapon,bought FROM xs_weapons ORDER BY bought DESC LIMIT 1")
        exevents = weapons.fetchone()
コード例 #5
0
ファイル: wcs.py プロジェクト: laiello/extendedstats
# WCS eXtended Stats addon version 1.0 by Ojii

import path, es
from extendedstats import extendedstats as xs
wcsIsLoaded = xs.addonIsLoaded('wcs')
if wcsIsLoaded:
    columns = [
        ('wcs_ultimates_used','INTEGER DEFAULT 0'),
        ('wcs_abilities_used','INTEGER DEFAULT 0'),
    ]

def load():
    if wcsIsLoaded:
        xs.registerEvent('wcs','player_ultimate_on',player_ultimate_on)
        xs.registerEvent('wcs','player_ability_on',player_ability_on)
        xs.registerEvent('wcs','player_ability_on2',player_ability_on)

def player_ultimate_on(ev):
    steamid = xs.sid(ev)
    xs.players.increment(steamid,'wcs_ultimats_used')

def player_ability_on(ev):
    steamid = xs.sid(ev)
    xs.players.increment(steamid,'wcs_abilities_used')
コード例 #6
0
ファイル: gungame.py プロジェクト: laiello/extendedstats
from extendedstats import extendedstats
import es, path

scfg = extendedstats.scfg

GG = extendedstats.addonIsLoaded('gungame')
if not GG:
    GG = str(es.ServerVar('sm_gungame_enabled')) == '1'

if GG: # check if gungame is present on the server
    columns = [
        ('gg_level','INTEGER DEFAULT 0'),
        ('gg_win','INTEGER DEFAULT 0'),
    ]
    extendedstats.players.addColumns(columns)

def load():
    if GG:
        extendedstats.registerCommand(scfg.command_gungame_ggwon,'gungame',ggwon_command)
        extendedstats.loadEvents('gungame')
    else:
        extendedstats.dbg( 'XS:GG: No gungame files found')
        
def ggwon_command(userid,arguments):
    if str(userid) in extendedstats.pending:
        es.tell(userid,extendedstats.text.getSimple('messages','sorry_pending'))
        return
    es.tell(userid,text.getCmdString(es.getplayersteamid(userid),'ggwon','__standard__',0,0,0))