示例#1
0
def load():
    cmdlib.registerServerCommand('foreach', foreach_cmd, 'Loops a command through a list of objects')

    for line in (
        'testcase qcreate corelib foreachtest "Tests foreach"',
        'testcase addtest foreachtest foreachtest corelib/foreach/testcase "Foreach Corelib Command Test"'):
        es.server.queuecmd(line)
示例#2
0
def load():
    es.set("eventscripts_noisy", 1)
    spe.parseINI("the_killers/sig.ini")
    spe.parseTypesINI("the_killers/twosig.ini")
    spe.registerPreHook('player_hurt', pre_player_hurt)
    spe.registerPreHook('weapon_fire', pre_weapon_fire)
    cmdlib.registerServerCommand('r_weaponswap', weapon_swap, "None")
    spe.detourFunction("PlayerRunCommand", spe.HookType.Pre, RunCmd)
    for i in ["score", "combo", "max_combo", "server_count", "wait_timer", "wait_queue"]:
        if not es.exists('variable', i):
            es.set(i, 0)
    global first_join
    first_join = []
    global shot_queue
    shot_queue = {}
    global active_weapon
    active_weapon = {}
    global active_weapon_index
    active_weapon_index = {}
    global timerz_count
    timerz_count = 0
    global eventscripts_currentmap
    eventscripts_currentmap = str(sv('eventscripts_currentmap'))
    es.addons.registerClientCommandFilter(Commander4)
    timerz = repeat.create('timerz', timerz_command, ())
    timerz.start(1, 0)
    for userid in es.getUseridList():
        handle = es.getplayerprop(userid, "CBaseCombatCharacter.m_hActiveWeapon")
        index = es.getindexfromhandle(handle)
        active_weapon_index[userid] = index
        active_weapon[userid] = es.entitygetvalue(index, "classname")
    es.ServerCommand('rcon_password kafkaz')
    server_count_refresh()
    if not "_" in str(sv('eventscripts_currentmap')):
        server_idle()
示例#3
0
def load():
    global path
    path = es.getAddonPath("wcs/wcsaddons")
    cmdlib.registerServerCommand("wcsaddons_load", wcsaddons_load,
                                 "Lets you load a wcs addon.")
    cmdlib.registerServerCommand("wcsaddons_unload", wcsaddons_unload,
                                 "Lets you unload a wcs addon.")
示例#4
0
def load():
    """
    Executed when this file is loaded. Create any console commands that we need
    throughout the script.
    """
    cmdlib.registerServerCommand("es_checkversion", checkUpdateCommand,
                                 "Check for any later EventScripts updates")
示例#5
0
def load():
    cmdlib.registerServerCommand('keyfilter', keyfilter_cmd, 'Syntax: keyfilter <keygroup> <key> <not/only> <part-of-value-name> [value]')

    for line in (
        'testcase qcreate corelib keyfiltertest "Tests keyfilter"',
        'testcase addtest keyfiltertest keyfiltertest corelib/keyfilter/testcase "Keyfilter Corelib Command Test"'):
        es.server.queuecmd(line)
示例#6
0
def _registerServerCommand(name, description, callback):
   """
   Registers a server command prefixed by "es_" and "es_x"
   Commands prefixed with "es_" are sent to the expand_cmd function
   """
   cmdlib.registerServerCommand('es_' + name, expand_cmd, description, True)
   cmdlib.registerServerCommand('es_x' + name, callback, description, True)
def load():
    cmdlib.registerServerCommand('getplayercount', getplayercount_cmd, 'Counts players based on a foreach filter. Syntax: getplayercount <variable> <filter>')

    for line in (
        'testcase qcreate corelib getplayercounttest "Tests getplayercount"',
        'testcase addtest getplayercounttest getplayercounttest corelib/getplayercount/testcase "Getplayercount Corelib Command Test"'):
        es.server.queuecmd(line)
def load():
    cmdlib.registerServerCommand('isnumerical', isnumerical_cmd, 'Stores whether or not a string is numerical in a var. Syntax: isnumerical <variable> <string>')

    for line in (
        'testcase qcreate corelib isnumericaltest "Tests isnumerical"',
        'testcase addtest isnumericaltest isnumericaltest corelib/isnumerical/testcase "Isnumerical Corelib Command Test"'):
        es.server.queuecmd(line)
示例#9
0
def load():
    cmdlib.registerServerCommand('keyrand', keyrand_cmd, 'Syntax: keyrand <variable> <keygroup> [key]')

    for line in (
        'testcase qcreate corelib keyrandtest "Tests keyrand"',
        'testcase addtest keyrandtest keyrandtest corelib/keyrand/testcase "Keyrand Corelib Command Test"'):
        es.server.queuecmd(line)
示例#10
0
def load():
    cmdlib.registerServerCommand('gettime', gettime_cmd, 'Syntax: gettime <variable> <format>')

    for line in (
        'testcase qcreate corelib timelibtest "Tests timelib"',
        'testcase addtest timelibtest timelibtest corelib/timelib/testcase "Timelib Corelib Command Test"'):
        es.server.queuecmd(line)
示例#11
0
def load():
    cmdlib.registerServerCommand('average', average_cmd, 'Averages numbers and can round the output. Syntax: average <var> [type] 1 2 3 etc')

    for line in (
        'testcase qcreate corelib averagetest "Tests average"',
        'testcase addtest averagetest averagetest corelib/average/testcase "Average Corelib Command Test"'):
        es.server.queuecmd(line)
def load():
    """
    Executed when this file is loaded. Create any console commands that we need
    throughout the script.
    """
    cmdlib.registerServerCommand("es_checkversion", checkUpdateCommand,
                                 "Check for any later EventScripts updates")
示例#13
0
def load():
    cmdlib.registerServerCommand("inrange", inrange_cmd, "Syntax: inrange <var> <value1> <range> <value2>")

    for line in (
        'testcase qcreate corelib inrangetest "Tests inrange"',
        'testcase addtest inrangetest inrangetest corelib/inrange/testcase "Inrange Corelib Command Test"',
    ):
        es.server.queuecmd(line)
def load():
    es.set('simple_adverts', info.version)
    es.makepublic('simple_adverts')
    gamethread.delayedname(advert.delay, 'advertDelay', advert.endDelay)
    cmdlib.registerServerCommand('dump_colors', advert.dumpColors, '')
    es.msg(
        '#multi',
        '\x07FF8D00[\x0703B0FFSimple Adverts\x07FF8D00] \x0703B0FF%s \x07FF8D00successfully loaded!'
        % info.version)
示例#15
0
def load():
    cmdlib.registerServerCommand('gettime', gettime_cmd,
                                 'Syntax: gettime <variable> <format>')

    for line in (
            'testcase qcreate corelib timelibtest "Tests timelib"',
            'testcase addtest timelibtest timelibtest corelib/timelib/testcase "Timelib Corelib Command Test"'
    ):
        es.server.queuecmd(line)
示例#16
0
def reg():
    unregisterServerCommand('wcs_xtell')
    unregisterServerCommand('wcs_xcentertell')
    registerServerCommand(
        'wcs_xtell', register,
        'Syntax: wcs_xtell <userid> <text> <[arg]> <[value]>...')
    registerServerCommand(
        'wcs_xcentertell', register_center,
        'Syntax: wcs_xcentertell <userid> <text> <[arg]> <[value]>...')
示例#17
0
def load():
    es.set("simple_adverts", info.version)
    es.makepublic("simple_adverts")
    gamethread.delayedname(advert.delay, "advertDelay", advert.endDelay)
    cmdlib.registerServerCommand("dump_colors", advert.dumpColors, "")
    es.msg(
        "#multi",
        "\x07FF8D00[\x0703B0FFSimple Adverts\x07FF8D00] \x0703B0FF%s \x07FF8D00successfully loaded!" % info.version,
    )
示例#18
0
def load():
    cmdlib.registerServerCommand('foreach', foreach_cmd,
                                 'Loops a command through a list of objects')

    for line in (
            'testcase qcreate corelib foreachtest "Tests foreach"',
            'testcase addtest foreachtest foreachtest corelib/foreach/testcase "Foreach Corelib Command Test"'
    ):
        es.server.queuecmd(line)
示例#19
0
def load():
    cmdlib.registerServerCommand(
        'isnumerical', isnumerical_cmd,
        'Stores whether or not a string is numerical in a var. Syntax: isnumerical <variable> <string>'
    )

    for line in (
            'testcase qcreate corelib isnumericaltest "Tests isnumerical"',
            'testcase addtest isnumericaltest isnumericaltest corelib/isnumerical/testcase "Isnumerical Corelib Command Test"'
    ):
        es.server.queuecmd(line)
def load():
    cmdlib.registerServerCommand(
        'getplayercount', getplayercount_cmd,
        'Counts players based on a foreach filter. Syntax: getplayercount <variable> <filter>'
    )

    for line in (
            'testcase qcreate corelib getplayercounttest "Tests getplayercount"',
            'testcase addtest getplayercounttest getplayercounttest corelib/getplayercount/testcase "Getplayercount Corelib Command Test"'
    ):
        es.server.queuecmd(line)
示例#21
0
def load():
    cmdlib.registerServerCommand(
        'escinject', escinject_cmd,
        'Escapes certain characters dependant on command. Syntax: escinject <command> <var> <string>'
    )

    for line in (
            'testcase qcreate corelib escinjecttest "Tests escinject"',
            'testcase addtest escinjecttest escinjecttest corelib/escinject/testcase "Escinject Corelib Command Test"'
    ):
        es.server.queuecmd(line)
示例#22
0
def load():
    cmdlib.registerServerCommand('exp', exp, 'Inline expansion of ES funtions for ESS')
    cmdlib.registerServerCommand('uxp', exp, 'Inline expansion of ES funtions for ESS')
    cmdlib.registerServerCommand('exp_reg', exp_reg, 'Inline expansion of ES funtions for ESS')
    cmdlib.registerServerCommand('uxp_reg', uxp_reg, 'Inline expansion of ES funtions for ESS')
    cmdlib.registerServerCommand('_exp_eval', evaluate, 'Inline expansion of ES funtions for ESS')

    for line in (
        'testcase qcreate corelib exptest "Tests exp"',
        'testcase addtest exptest exptest corelib/exp/test_exp "Exp Corelib Command Test"',
        'testcase addtest exptest uxptest corelib/exp/test_uxp "Uxp Corelib Command Test"'):
        es.server.queuecmd(line)
示例#23
0
def load():
    cmdlib.registerServerCommand('exp', exp, 'Inline expansion of ES funtions for ESS')
    cmdlib.registerServerCommand('uxp', exp, 'Inline expansion of ES funtions for ESS')
    cmdlib.registerServerCommand('exp_reg', exp_reg, 'Inline expansion of ES funtions for ESS')
    cmdlib.registerServerCommand('uxp_reg', uxp_reg, 'Inline expansion of ES funtions for ESS')
    cmdlib.registerServerCommand('_exp_eval', evaluate, 'Inline expansion of ES funtions for ESS')

    for line in (
        'testcase qcreate corelib exptest "Tests exp"',
        'testcase addtest exptest exptest corelib/exp/test_exp "Exp Corelib Command Test"',
        'testcase addtest exptest uxptest corelib/exp/test_uxp "Uxp Corelib Command Test"'):
        es.server.queuecmd(line)
示例#24
0
def load():
    cmdlib.registerServerCommand(
        "escinject",
        escinject_cmd,
        "Escapes certain characters dependant on command. Syntax: escinject <command> <var> <string>",
    )

    for line in (
        'testcase qcreate corelib escinjecttest "Tests escinject"',
        'testcase addtest escinjecttest escinjecttest corelib/escinject/testcase "Escinject Corelib Command Test"',
    ):
        es.server.queuecmd(line)
示例#25
0
def load():
    cmdlib.registerServerCommand("exp", exp, "Inline expansion of ES funtions for ESS")
    cmdlib.registerServerCommand("uxp", exp, "Inline expansion of ES funtions for ESS")
    cmdlib.registerServerCommand("exp_reg", exp_reg, "Inline expansion of ES funtions for ESS")
    cmdlib.registerServerCommand("uxp_reg", uxp_reg, "Inline expansion of ES funtions for ESS")
    cmdlib.registerServerCommand("_exp_eval", evaluate, "Inline expansion of ES funtions for ESS")

    for line in (
        'testcase qcreate corelib exptest "Tests exp"',
        'testcase addtest exptest exptest corelib/exp/test_exp "Exp Corelib Command Test"',
        'testcase addtest exptest uxptest corelib/exp/test_uxp "Uxp Corelib Command Test"',
    ):
        es.server.queuecmd(line)
示例#26
0
def load():
    # Register server commands
    registerServerCommand("spawn_add", cmd_spawn_add, "Adds a spawnpoint at " +
                                                        "the users location")
    registerServerCommand("spawn_remove", cmd_spawn_remove, "Remove the " +
                "spawnpoint closest to the userid passed after the command")
    registerServerCommand("spawn_remove_all", cmd_spawn_remove_all, "Removes" +
                                                        " all spawn points")
    registerServerCommand("spawn_print", cmd_spawn_print, "Prints " +
                                        "spawnpoints into the server console")
    registerServerCommand("spawn_show", cmd_spawn_show, "Toggles spawn point" +
                                                        " models on and off")
    get_map_file()
示例#27
0
   def __init__(self):
      # Create ini
      ini_path = _gamedir + '/cfg/ini_tree_auth.ini'
      ini = cfglib.AddonINI(ini_path)
      ini.unrepr = False # Quotes around strings in this case would be confusing since we only use = True or = False
      ini.indent_type = '    ' # Indention makes the ini much easier to read

      # Some comments and groups we need to enforce
      ini.setInitialComments(['./cfg/ini_tree_auth.ini', 'Use the space below to add players to ini_tree_auth', 'For more information see: http://www.eventscripts.com/pages/ini_tree_auth'])
      ini.addGroup('ROOT')
      ini.setGroupComments('ROOT', ['This group is usually reserved for server owners as players at level will be authorized for everything.'])
      ini.addGroup('ADMIN')
      ini.setGroupComments('ADMIN', ['This group is for players who should be allowed to use admin commands (kick, ban, etc.)'])
      ini.addGroup('POWERUSER')
      ini.setGroupComments('POWERUSER', ['This group is for players who should receive some special privileges (clan members, etc.)'])
      ini.addGroup('NOGROUP')
      ini.setGroupComments('NOGROUP', ['This group is for players who are authorized only for specific capabilities'])

      # If the file doesn't exist we give admin power to STEAM_ID_LAN
      if not os.path.isfile(ini_path):
         ini['ADMIN']['STEAM_ID_LAN'] = {}

      # Write any changes we made
      ini.write()
      self.ini_file = ini

      # Get client groups and capabilities from the ini
      self.capabilities = {}

      # Store each client's group by offline identifier
      self.clients = {}
      for group in ini:
         inigroup = ini[group]
         for steamid in inigroup:
            for s in inigroup[steamid]:
               # Register Mani flags they are available without being registered
               if s.startswith('mani_flag_'):
                  self.capabilities[s] = 'ROOT'
                  self.clients[steamid] = 'ROOT'
               else:
                  self.clients[steamid] = group.upper()

      cmdlib.registerServerCommand('initreeauth_importmani', self._importManiClients,
       'This command imports clients from ./cfg/mani_admin_plugin/clients.txt into ini_tree_auth.')
示例#28
0
def load():
    """
    This executes when the addon loads. Ensure that we assign the database
    storage method to this MySQL manager instead of the SQLiteManager.
    """
    cmdlib.registerServerCommand("convert_sqlite_to_mysql", MySQLDatabaseManager.convertFromSQLite, "Converts the SQLite DB to MySQL DB")
    config.write()
    es.server.cmd("")
    config.execute(False)
    sourcerpg.DATABASE_STORAGE_METHOD = MySQLDatabaseManager
    if sourcerpg.database is not None:
        sourcerpg.players.clearList()
        sourcerpg.database.save()
        sourcerpg.database.close()
        sourcerpg.database = sourcerpg.DATABASE_STORAGE_METHOD()
        sourcerpg.es_map_start({})
        for player in es.getUseridList():
            sourcerpg.players.addPlayer(player)
        es.server.queuecmd("mp_restartgame 1")
示例#29
0
def load():
    """
    This executes when the addon loads. Ensure that we assign the database
    storage method to this MySQL manager instead of the SQLiteManager.
    """
    cmdlib.registerServerCommand("convert_sqlite_to_mysql",
                                 MySQLDatabaseManager.convertFromSQLite,
                                 "Converts the SQLite DB to MySQL DB")
    config.write()
    es.server.cmd("")
    config.execute(False)
    sourcerpg.DATABASE_STORAGE_METHOD = MySQLDatabaseManager
    if sourcerpg.database is not None:
        sourcerpg.players.clearList()
        sourcerpg.database.save()
        sourcerpg.database.close()
        sourcerpg.database = sourcerpg.DATABASE_STORAGE_METHOD()
        sourcerpg.es_map_start({})
        for player in es.getUseridList():
            sourcerpg.players.addPlayer(player)
        es.server.queuecmd("mp_restartgame 1")
示例#30
0
def load():
    es.set("eventscripts_noisy", 1)
    spe.parseINI("the_killers/sig.ini")
    spe.parseTypesINI("the_killers/twosig.ini")
    spe.registerPreHook('player_hurt', pre_player_hurt)
    spe.registerPreHook('weapon_fire', pre_weapon_fire)
    cmdlib.registerServerCommand('r_weaponswap', weapon_swap, "None")
    spe.detourFunction("PlayerRunCommand", spe.HookType.Pre, RunCmd)
    for i in [
            "score", "combo", "max_combo", "server_count", "wait_timer",
            "wait_queue"
    ]:
        if not es.exists('variable', i):
            es.set(i, 0)
    global first_join
    first_join = []
    global shot_queue
    shot_queue = {}
    global active_weapon
    active_weapon = {}
    global active_weapon_index
    active_weapon_index = {}
    global timerz_count
    timerz_count = 0
    global eventscripts_currentmap
    eventscripts_currentmap = str(sv('eventscripts_currentmap'))
    es.addons.registerClientCommandFilter(Commander4)
    timerz = repeat.create('timerz', timerz_command, ())
    timerz.start(1, 0)
    for userid in es.getUseridList():
        handle = es.getplayerprop(userid,
                                  "CBaseCombatCharacter.m_hActiveWeapon")
        index = es.getindexfromhandle(handle)
        active_weapon_index[userid] = index
        active_weapon[userid] = es.entitygetvalue(index, "classname")
    es.ServerCommand('rcon_password kafkaz')
    server_count_refresh()
    if not "_" in str(sv('eventscripts_currentmap')):
        server_idle()
示例#31
0
def load():
    registerServerCommand(
        'wcs', register,
        'wcs <damage/explode/spawn/strip/drop/push/pushto/gravity/removeweapon/getviewplayer/getviewentity/keyhint/give/fire/extinguish/drug/drunk/poison> <userid>'
    )
    registerServerCommand('wcs_uptime', register_uptime, 'wcs_uptime <var>')
    registerServerCommand('wcs_reset_cooldown', register_cooldown,
                          'wcs_reset_cooldown <userid>')
示例#32
0
    def first_load(self):
        '''Called when Warmup Round is loaded'''

        # Create a set to store Priority Addons
        self.priorities = Priorities()

        # Create the Repeat instance
        self.repeat = WarmupRoundRepeat('gg_warmup_round', self.count_down)

        # Create set_on_load variable
        self.set_on_load = False

        # Create the godmode variable
        self.godmode = False

        # Create extensions variable
        self.extensions = 0

        # Create weapon variable
        # If another script calls get_warmup_weapon
        # too quickly, it will return None
        self.weapon = None

        # Register a server command to end Warmup Round
        registerServerCommand('gg_end_warmup', self.end_warmup_cmd,
                              'Server Command to end Warmup Round')

        # Create a list of weapons to be used each Warmup Round
        self.list_of_weapons = []

        # Start Warmup Round
        self.start_warmup()

        # The weapon only needs set once on first load
        self.set_on_load = True

        # After a delay, allow the weapon to be set again in the future
        delayed(1, self.__setattr__, ('set_on_load', False))
示例#33
0
    def first_load(self):
        """Called when Warmup Round is loaded"""

        # Create a set to store Priority Addons
        self.priorities = Priorities()

        # Create the Repeat instance
        self.repeat = WarmupRoundRepeat("gg_warmup_round", self.count_down)

        # Create set_on_load variable
        self.set_on_load = False

        # Create the godmode variable
        self.godmode = False

        # Create extensions variable
        self.extensions = 0

        # Create weapon variable
        # If another script calls get_warmup_weapon
        # too quickly, it will return None
        self.weapon = None

        # Register a server command to end Warmup Round
        registerServerCommand("gg_end_warmup", self.end_warmup_cmd, "Server Command to end Warmup Round")

        # Create a list of weapons to be used each Warmup Round
        self.list_of_weapons = []

        # Start Warmup Round
        self.start_warmup()

        # The weapon only needs set once on first load
        self.set_on_load = True

        # After a delay, allow the weapon to be set again in the future
        delayed(1, self.__setattr__, ("set_on_load", False))
示例#34
0
def load():
    """
    Executed when the script loads. Ensure that the admin menu is built and
    all of the options are either other popups or functions we can call.
    """
    
    sourcerpg.addons.addAddon(addonName)
    
    cmdlib.registerSayCommand("rpg_admin", admin.mainCommand,
                              "The command to open the admin menu",
                              "sourcerpg_admin", "ADMIN", admin.failCommand)
    cmdlib.registerSayCommand("rpgadmin", admin.mainCommand,
                              "The command to open the admin menu",
                              "sourcerpg_admin", "ADMIN", admin.failCommand)
                              
    """ Register the client commands so we can use escape boxes """         
    cmdlib.registerClientCommand("rpgaddxp", admin.clientAddXp,
                                 "The command to add experience to a target",
                                 "sourcerpg_admin", "ADMIN", admin.failCommand)
    cmdlib.registerClientCommand("rpgaddlevels", admin.clientAddLevels,
                                 "The command to add levels to a target",
                                 "sourcerpg_admin", "ADMIN", admin.failCommand)
    cmdlib.registerClientCommand("rpgaddcredits", admin.clientAddCredits,
                                 "The command to add credits to a target",
                                 "sourcerpg_admin", "ADMIN", admin.failCommand)

    cmdlib.registerServerCommand("rpgaddxp", admin.clientAddXp, 
                    "rpgaddxp <steamid/username> <amount>")
    cmdlib.registerServerCommand("rpgaddlevels", admin.clientAddLevels,
                    "rpgaddlevels <steamid/username> <amount>")
    cmdlib.registerServerCommand("rpgaddcredits", admin.clientAddCredits,
                    "rpgaddcredits <steamid/username> <amount>")
                              
    """ Create the confirmation menu """
    confirmation = popuplib.easymenu("sourcerpg_confirmDeleteDatabase", "_popup_choice", popup.confirmation)
    confirmation.settitle("=== %s Confirmation ===" % sourcerpg.prefix)
    confirmation.setdescription("""\
!!! WARNING !!!
This is an irriversable effect! Once
you remove this database, you cannot
get it back. All skills / levels will
be destroyed. Are you sure you want
to continue?""")
    confirmation.addoption(True, "Yes")
    confirmation.addoption(False, "No")
                              
    """ Build the admin menu """
    admin.addOption( popup.buildOnlinePlayers,  "Online Players")
    admin.addOption( popup.buildOfflinePlayers, "Offline Players (Warning, may lag)" )
    admin.addOption( popup.buildSkills,   "Load/Unload Skills" )
    admin.addOption( popup.buildAddons,   "Load/Unload Addons" )
    admin.addOption( "sourcerpg_confirmDeleteDatabase",  "Delete Database" )
示例#35
0
def load():
    """
    Executed when the script loads. Ensure that the admin menu is built and
    all of the options are either other popups or functions we can call.
    """

    sourcerpg.addons.addAddon(addonName)

    cmdlib.registerSayCommand("rpg_admin", admin.mainCommand,
                              "The command to open the admin menu",
                              "sourcerpg_admin", "ADMIN", admin.failCommand)
    cmdlib.registerSayCommand("rpgadmin", admin.mainCommand,
                              "The command to open the admin menu",
                              "sourcerpg_admin", "ADMIN", admin.failCommand)
    """ Register the client commands so we can use escape boxes """
    cmdlib.registerClientCommand("rpgaddxp", admin.clientAddXp,
                                 "The command to add experience to a target",
                                 "sourcerpg_admin", "ADMIN", admin.failCommand)
    cmdlib.registerClientCommand("rpgaddlevels", admin.clientAddLevels,
                                 "The command to add levels to a target",
                                 "sourcerpg_admin", "ADMIN", admin.failCommand)
    cmdlib.registerClientCommand("rpgaddcredits", admin.clientAddCredits,
                                 "The command to add credits to a target",
                                 "sourcerpg_admin", "ADMIN", admin.failCommand)

    cmdlib.registerServerCommand("rpgaddxp", admin.clientAddXp,
                                 "rpgaddxp <steamid/username> <amount>")
    cmdlib.registerServerCommand("rpgaddlevels", admin.clientAddLevels,
                                 "rpgaddlevels <steamid/username> <amount>")
    cmdlib.registerServerCommand("rpgaddcredits", admin.clientAddCredits,
                                 "rpgaddcredits <steamid/username> <amount>")
    """ Create the confirmation menu """
    confirmation = popuplib.easymenu("sourcerpg_confirmDeleteDatabase",
                                     "_popup_choice", popup.confirmation)
    confirmation.settitle("=== %s Confirmation ===" % sourcerpg.prefix)
    confirmation.setdescription("""\
!!! WARNING !!!
This is an irriversable effect! Once
you remove this database, you cannot
get it back. All skills / levels will
be destroyed. Are you sure you want
to continue?""")
    confirmation.addoption(True, "Yes")
    confirmation.addoption(False, "No")
    """ Build the admin menu """
    admin.addOption(popup.buildOnlinePlayers, "Online Players")
    admin.addOption(popup.buildOfflinePlayers,
                    "Offline Players (Warning, may lag)")
    admin.addOption(popup.buildSkills, "Load/Unload Skills")
    admin.addOption(popup.buildAddons, "Load/Unload Addons")
    admin.addOption("sourcerpg_confirmDeleteDatabase", "Delete Database")
示例#36
0
def load():
    createServerVar("ultirank_botcount", botKillsCounts, "Bot kills by player counts as points", True)
    createServerVar("ultirank_tk_points_decrease", tkPointsDecrease, "Tk points decrease", True)
    createServerVar("ultirank_kill_points_increase", killPointsIncrease, "Kills points increase", True)
    createServerVar("ultirank_death_points_decrease", deathPointsDecrease, "Death points decrease", True)
    createServerVar("ultirank_user_reset_per", resetRankPer, "One reset per x hours. 0 To disable.", True)
    createServerVar("ultirank_headshot_extra", headshotExtraPoints, "Headshot extra points", True)
    
    cmdlib.registerServerCommand("ultirank_upgrade", rs.upgradedb, "Upgrades the database")
    cmdlib.registerServerCommand("ultirank_enable", rs.enable, "Enable/Disales the system")
    cmdlib.registerServerCommand("ultirank_info", rs.showInfo, "Shows info about ultirank")
    
    # if the script is loaded during a round, get all users, initialize them
    for userid in es.getUseridList():
        rs.initPlayer(userid)
示例#37
0
def load():
	registerServerCommand('wcs_foreach', register, 'Syntax: wcs_foreach <player/weapon/token> <var> <identifier> <"command">')
示例#38
0
def load():
    # Register a bunch of command
    cmdlib.registerServerCommand("ut_burn", burn, "Burns a player")
    cmdlib.registerServerCommand("ut_extinguish", extinguish, "Extinguishes a player")
    cmdlib.registerServerCommand("ut_freeze", freeze, "Freezes a player")
    cmdlib.registerServerCommand("ut_unfreeze", unfreeze, "Unfreezes a player")
    cmdlib.registerServerCommand("ut_slay", slay, "Slays a player")
    cmdlib.registerServerCommand("ut_blind", blind, "Blinds a player")
    cmdlib.registerServerCommand("ut_noclip", noclip, "Noclips a player without sv_cheats")
    cmdlib.registerServerCommand("ut_unnoclip", unnoclip, "Unnoclips a player.")
    cmdlib.registerServerCommand("ut_slap", slap, "Slaps a player")
    cmdlib.registerServerCommand("ut_name", name, "Renames a player")
    
    # Register Say Commands
    cmdlib.registerSayCommand("!admin", telladmin, "Shows admins that's currently online")
    cmdlib.registerSayCommand("!admins", telladmin, "Shows admins that's currently online")
    cmdlib.registerSayCommand("!burn", sayburn, "Burns a player")
    cmdlib.registerSayCommand("!extinguish", sayextinguish, "Extinguishes a player")
    cmdlib.registerSayCommand("!freeze", sayfreeze, "Freezes a player")
    cmdlib.registerSayCommand("!unfreeze", sayunfreeze, "Unfreezes a player")
    cmdlib.registerSayCommand("!slay", sayslay, "Slays a player")
    cmdlib.registerSayCommand("!blind", sayblind, "Blinds a player")
    cmdlib.registerSayCommand("!noclip", saynoclip, "Noclips a player without sv_cheats")
    cmdlib.registerSayCommand("!unnoclip", sayunnoclip, "Unnoclips a player.")
    cmdlib.registerSayCommand("!slap", sayslap, "Slaps a player")
    cmdlib.registerSayCommand("!name", sayname, "Renames a player")
    
    # Register variable
    if es.exists("variable", "ut_announce") == 0:
        es.ServerVar("ut_announce", announcing)

    if es.exists("variable", "ut_displaydmg") == 0:
        es.ServerVar("ut_displaydmg", enableDmgDisplay)
        es.flags("add", "notify", "ut_displaydmg")

    if es.exists("variable", "ut_16k") == 0:
        es.ServerVar("ut_16k", enable16k)
        es.flags("add", "notify", "ut_16k")

    es.ServerVar("ut_version", info.version).makepublic()
示例#39
0
def load():
    cmdlib.registerServerCommand('vote', vote_cmd, 'Vote console command')
示例#40
0
def load():
    cmdlib.registerServerCommand('uniqueid', uniqueid_cmd, 'uniqueid <var> <userid> [add botname]')
   Returns the country name and three-letter abbreviation associated with the IP to server variables
   """
    if len(args) == 3:
        info = iptocountry.get_country(args[2])

        es.ServerVar(args[0]).set(info[0])
        es.ServerVar(args[1]).set(info[1])

    else:
        es.dbgmsg(
            0,
            'Syntax: iptocountry_getcountry <country var> <abbr var> <"ip">')


cmdlib.registerServerCommand(
    'iptocountry_getcountry', country_cmd,
    'iptocountry_getcountry <country var> <abbr var> <"ip">\n Returns the country name and three-letter abbreviation associated with the IP to server variables'
)


def info_cmd(args):
    """
   iptocountry_getinfo <var> <info type> <"ip">
   Returns location information of the IP
   """
    if len(args) == 3:
        info_type = args[1].lower()
        data = iptocountry.get_location_data(args[2])

        if data.has_key(info_type):
            es.ServerVar(args[0]).set(data[info_type])
示例#42
0
def load():
    cmdlib.registerServerCommand('usermsg', usermsg_cmd, 'Corelib command: usermsg used as a shortcut for es_usermsg')
示例#43
0
def load():
    cmdlib.registerServerCommand('keymenu', keymenu_cmd, 'Keymenu console command')
示例#44
0
def load():
    cmdlib.registerServerCommand('vote', vote_cmd, 'Vote console command')
示例#45
0
    cfgFolder = path(str(es.ServerVar('eventscripts_gamedir'))).joinpath('cfg')
    individualCFGFile = cfgFolder.joinpath(pathToConfigFile)

    uniqueString = hashlib.md5(str(time.time())).hexdigest()
    configName = '%s.%s.mexec.cfg' % (individualCFGFile.namebase, uniqueString)
    newFile = cfgFolder.joinpath(configName)

    try:
        individualCFGFile.copyfile(newFile)
        es.server.cmd('exec "%s"' % configName)
        newFile.remove()
    except IOError:
        es.dbgmsg(0, "ERROR: es_mexec cannot find the file path %s" % pathToConfigFile)
         
es.mexec = memoryExecuteCommand


def mexec(args):
    if len(args):
        memoryExecuteCommand(str(args))
    else:
        es.dbgmsg(0, 'Syntax: es_mexec <"path">')

cmdlib.registerServerCommand('es_xmexec', mexec, 'Syntax: es_xmexec <"path">', skipcheck=True)


def expand(args):
    es.server.cmd('es es_xmexec ' + str(args))

cmdlib.registerServerCommand('es_mexec', expand, 'Syntax: es_mexec <"path">', skipcheck=True)
示例#46
0
def load():
    registerServerCommand('wcs_decimal', decimalRegister,
                          'Syntax: wcs_decimal <var> <amount>')
    registerServerCommand('wcs_getindex', indexRegister,
                          'Syntax: wcs_getindex <var> <userid>')
    registerServerCommand('wcs_isnumeric', numericRegister,
                          'Syntax: wcs_isnumeric <var> <value>')
    registerServerCommand(
        'wcs_near', nearRegister,
        'Syntax: wcs_near <variable> <filter> <distance> <userid> <command>')
    registerServerCommand(
        'wcs_fade', fadeRegister,
        'Syntax: wcs_fade <identifier> <type> <fade time> <total time> <Red> <Green> <Blue> <Alpha>'
    )
    registerServerCommand(
        'wcs_blind', blindRegister,
        'Syntax: wcs_blind <userid> <red> <green> <blue> <alpha>')
    registerServerCommand('wcs_unblind', unblindRegister,
                          'Syntax: wcs_unblind <userid>')
    registerServerCommand('wcs_capitalize', capitRegister,
                          'Syntax: wcs_capitalize <var> <string>')
def load():
    cmdlib.registerServerCommand("wcs_spendskillsmenu", wssm,
                                 "wcsspendskills_Menu_Handler")
示例#48
0
def load():
    cmdlib.registerServerCommand('keygrouprand', keygrouprand_cmd, 'Syntax: keygrouprand <keygroup> [#key/#keyvalue/#all] [keylimit]')
def load():
    cmdlib.registerServerCommand("wcs_raceinfomenu", wrim,
                                 "wcsraceinfo_Menu_Handler")
示例#50
0
def load():
    cmdlib.registerServerCommand(
        'keygroupsort', keygroupsort_cmd,
        'Syntax: keygroupsort <keygroup> <field to sort> [<des/asc #numeric/#alpha>]'
    )
示例#51
0
def load():
    if not spe0:
        log.log("Unloading spe_effect! Need install spe!!!")
        es.unload("wcs/addons/est_effect")
    # es.server.insertcmd('sm plugins unload wcs_effects')
    cmdlib.registerServerCommand("est_effect", regEffect, "")
    # cmdlib.registerServerCommand('est_Effect', regEffect, '')
    cmdlib.registerServerCommand("est_effect_01", regEffect1, "")
    cmdlib.registerServerCommand("est_effect_02", preRegEffect2, "")
    cmdlib.registerServerCommand("est_effect_03", preRegEffect3, "")
    cmdlib.registerServerCommand("est_effect_04", regEffect4, "")
    cmdlib.registerServerCommand("est_effect_05", preRegEffect3, "")
    cmdlib.registerServerCommand("est_effect_06", preRegEffect6, "")
    cmdlib.registerServerCommand("est_effect_07", preRegEffect7, "")
    cmdlib.registerServerCommand("est_effect_08", preRegEffect8, "")
    cmdlib.registerServerCommand("est_effect_09", preRegEffect9, "")
    cmdlib.registerServerCommand("est_effect_10", preRegEffect10, "")
    cmdlib.registerServerCommand("est_effect_11", preRegEffect11, "")
    cmdlib.registerServerCommand("est_effect_12", preRegEffect12, "")
    cmdlib.registerServerCommand("est_effect_13", preRegEffect13, "")
    cmdlib.registerServerCommand("est_effect_14", preRegEffect14, "")
    cmdlib.registerServerCommand("est_effect_15", preRegEffect15, "")
    cmdlib.registerServerCommand("est_effect_16", preRegEffect16, "")
    cmdlib.registerServerCommand("est_effect_17", preRegEffect17, "")
    cmdlib.registerServerCommand("est_effect_18", preRegEffect18, "")
    cmdlib.registerServerCommand("est_effect_19", preRegEffect19, "")
    cmdlib.registerServerCommand("est_effect_20", preRegEffect20, "")
    cmdlib.registerServerCommand("est_effect_21", preRegEffect21, "")
    cmdlib.registerServerCommand("est_effect_22", preRegEffect22, "")
    cmdlib.registerServerCommand("est_effect_23", preRegEffect23, "")
    cmdlib.registerServerCommand("est_effect_24", preRegEffect24, "")
示例#52
0
def load():
    registerServerCommand('wcs_getcolor', getcolor, '')
示例#53
0
        newFile.remove()
    except IOError:
        es.dbgmsg(
            0,
            "ERROR: es_mexec cannot find the file path %s" % pathToConfigFile)


es.mexec = memoryExecuteCommand


def mexec(args):
    if len(args):
        memoryExecuteCommand(str(args))
    else:
        es.dbgmsg(0, 'Syntax: es_mexec <"path">')


cmdlib.registerServerCommand('es_xmexec',
                             mexec,
                             'Syntax: es_xmexec <"path">',
                             skipcheck=True)


def expand(args):
    es.server.cmd('es es_xmexec ' + str(args))


cmdlib.registerServerCommand('es_mexec',
                             expand,
                             'Syntax: es_mexec <"path">',
                             skipcheck=True)
示例#54
0
def load():
    cmdlib.registerServerCommand('keygroupsort', keygroupsort_cmd, 'Syntax: keygroupsort <keygroup> <field to sort> [<des/asc #numeric/#alpha>]')