• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python xa.register函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中xa.xa.register函数的典型用法代码示例。如果您正苦于以下问题:Python register函数的具体用法?Python register怎么用?Python register使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了register函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: str

import es
import gamethread
import popuplib
import playerlib

from xa import xa

import psyco
psyco.full()

info = es.AddonInfo()
info.name     = 'Admin Give'
info.version  = '1.0.4'
info.basename = 'xaadmingive'

xaadmingive  			 = xa.register('xaadmingive')
xalanguage 			     = xaadmingive.language.getLanguage()
admingive_anonymous      = xaadmingive.setting.createVariable('admingive_anonymous' , 0, 'Whether or not giving a player a weapon is anonymous... 1 = Anonymous, 0 = Global')
admingive_stripfirst     = xaadmingive.setting.createVariable("admingive_stripfirst", 1, 'Whether or not the target is striped of their weapon before being gave another.\n // Will only strip the same slot as their being given.')

pistols  = ('usp','glock','p228','deagle','elite','fiveseven')
shotguns = ('m3','xm1014')
smgs     = ('tmp','mac10','mp5navy','ump45','p90')
rifles   = ('famas','galil','ak47','m4a1','sg552','aug')
snipers  = ('scout','sg550','g3sg1','awp')
grenades = ('hegrenade','smokegrenade','flashbang')
items    = ('vest','vesthelm','nvgs','c4','defuser')
admins   = {}
gamename = str(es.ServerVar('eventscripts_gamedir')).replace('\\', '/').split('/')[~0]

####################
开发者ID:StarsGame,项目名称:source_addons,代码行数:31,代码来源:xaadmingive.py


示例2: fixes

 - [FIX] bug fixes (module was still registering as xateamwound)
== 1.0.1 ==
 - [FIX] Problem where the player_team code tried to re-add players that had disconnected
== 1.0.0 ==
 - Released publicly
 - Name change to XAProtect
 - [+] Team kill protection
 - [FIX] Changed the protection levels from 5000 to 1124
== OY1 ==
 - [+] Added basic spawn protection (raised health)
 - [+] Added the ability to kill people who spawn kill
 - [+] Added reflect damage ability against team wounders
''' 

# register module with XA 
xaprotect = xa.register(info.basename) 

# Localization helper: 
#text = xaprotect.language.getLanguage() 

# make config vars 
protect_wound                     = xaprotect.setting.createVariable('protect_wound', 1, '1 = ON, 0 = OFF') 
protect_spawn_protection_time     = xaprotect.setting.createVariable('protect_spawn_protection_time', 3, 'The number of seconds to make people invulnerable at spawn (0 = OFF)') 
protect_spawn_protection_mode     = xaprotect.setting.createVariable('protect_spawn_protection_mode', 0, '(1 = Anytime players spawn, 0 = Only at round start)') 
protect_reflect_damage            = xaprotect.setting.createVariable('protect_reflect_damage', 0, '(0 = OFF, 1 = Reflect all damage, 2 = reflect some damage)') 
protect_reflect_damage_percentage = xaprotect.setting.createVariable('protect_reflect_damage_percentage', 10, '(0 to 10: the percentage of damage to reflect)') 
protect_spawn_slay                = xaprotect.setting.createVariable('protect_spawn_slay', 0, 'Slay spawn attackers(0=OFF, 1=ON)') 
protect_spawn_slay_time           = xaprotect.setting.createVariable('protect_spawn_slay_time', 3, '# of seconds after spawning an attacker is slayed for team attacking')    
protect_teamkill_slay             = xaprotect.setting.createVariable('protect_teamkill_slay', 0, 'Slay team killers(0=OFF, 1=ON)') 
protect_teamattack_slay           = xaprotect.setting.createVariable('protect_teamattack_slay', 0, 'Slay team attackers(0=OFF, 1=ON)') 
开发者ID:StarsGame,项目名称:source_addons,代码行数:30,代码来源:xaprotect.py


示例3:

import playerlib
from xa import xa

playertimes = {}
playerkills = {}
playerheads = {}
firstblood = False

#plugin information
info = es.AddonInfo()
info.name           = "Quake Sounds"
info.version        = "0.2"
info.author         = "Hunter"
info.basename       = "xaquakesounds"

xaquakesounds                       = xa.register(info.basename)
xalanguage                          = xaquakesounds.language.getLanguage()
xaplayerdata_quakesounds            = xaquakesounds.playerdata.createUserSetting('quakesounds')

if xa.isManiMode():
    xaquakesoundslist               = xaquakesounds.configparser.getAliasList('cfg/mani_admin_plugin/quakesoundlist.txt', True)
else:
    xaquakesoundslist               = xaquakesounds.configparser.getAliasList('quakesoundlist.txt')

quake_sounds                        = xaquakesounds.setting.createVariable('quake_sounds', '1', '0 = off, 1 = enable Quake Sounds')
quake_sounds_download               = xaquakesounds.setting.createVariable('quake_auto_download', '0', '0 = Don\'t auto download files to client, 1 = automatically download files to client')
quake_sounds_settings               = xaquakesounds.setting.createVariable('player_settings_quake', '1', '0 = player settings default to off, 1 = player settings default to on')
quake_kill_streak_mode              = xaquakesounds.setting.createVariable('quake_kill_streak_mode', '0', 'Reset kill streaks per round 1 = per round/death, 0 = per death')
quake_humiliation_mode              = xaquakesounds.setting.createVariable('quake_humiliation_mode', '1', '0 = off, 1 = all players hear it, 2 = players involved hear it, 3 = attacker hears it, 4 = victim hears it')
quake_humiliation_visual_mode       = xaquakesounds.setting.createVariable('quake_humiliation_visual_mode', '1', '0 = off, 1 = all players see it, 2 = players involved see it, 3 = attacker sees it, 4 = victim sees it')
quake_humiliation_weapon            = xaquakesounds.setting.createVariable('quake_humiliation_weapon', 'knife', 'Weapon that triggers the humiliation sound')
开发者ID:StarsGame,项目名称:source_addons,代码行数:31,代码来源:xaquakesounds.py


示例4: load

import es
import os
import cfglib
import popuplib
import playerlib
import langlib
import random
from xa import xa

info = es.AddonInfo()
info.name        = "Language Management"
info.version     = "0.1"
info.author      = "Hunter"
info.basename    = "xalanguage"

xalanguage = xa.register(info.basename)
xalang = xalanguage.language.getLanguage()
langlist = {}
menulist = []

def load():
    global menulist,mainmenu
    xaclientcmd = xalanguage.addCommand('setlanguage', _inputbox_handle, 'change_language', 'ROOT', 'Set language')
    xaclientcmd.register('console')

    mainmenu = popuplib.easymenu('xamainlanguagemenu',None,_mainmenu_select)
    mainmenu.settitle(xalang['main language'])
    mainmenu.addoption('module', xalang['module language'])
    menulist.append(mainmenu)
    xalanguage.addMenu('xamainlanguagemenu',xalang['xa menu choice'],'xamainlanguagemenu','change_language','ROOT')
开发者ID:StarsGame,项目名称:source_addons,代码行数:30,代码来源:xalanguage.py


示例5: Player

1.3.1 | [FULL] | 16/02/2008 | Fixed a bunch of minor errors in player_team, commented out global variable
1.3.2 | [FULL] | 13/05/2008 | Fixed typo in player_team method/event
1.3.1 | [FULL] | 22/02/2009 | Fixed a chance where a key error could happen when a player would be checked before added to the dictionary.
--Future--
 #  |  Status       | Desc

1.5 | [UNSTARTED]   | Add other features, provide admin notification / features, add further config options
'''

# the dictionary to track blinded players
blinded = {}
# same idea but for spectators
spec_blinded = {}

# Register the module
ghosting = xa.register(info.basename) 

# Grab the languages file using the XA langlib wrapper
text = ghosting.language.getLanguage()

# Public variable for version
#es.ServerVar("xa_blind_ip_ghosters_ver",str(info.version), "Blind IP Ghosters, version").makepublic()

'''
Internal classes
'''
class Player(playerlib.Player):
    '''
    Extends playerlib.Player to provide special functions
    '''
    def blind(self):
开发者ID:StarsGame,项目名称:source_addons,代码行数:31,代码来源:xaipghosting.py


示例6: load

import es
from playerlib import getPlayerList
from xa import xa

info = es.AddonInfo()
info.name       = "Objectives"
info.version    = "0.1"
info.author     = "Wonder"
info.basename   = "xaobjectives"

xaobjectives = xa.register(info.basename)

def load():
    global slay, text

    slay = xaobjectives.setting.createVariable("css_objectives", "1", "If 1, losing team will be slain.")
    text = xaobjectives.language.getLanguage()

    if es.getgame() != "Counter-Strike: Source":
        raise AttributeError, "Counter-Strike: Source"

def unload():
    xaobjectives.unregister()

def round_end(eventVar):
    if int(slay):
        if eventVar["winner"] == "2" and es.getlivingplayercount(3):
            cts, ts = getPlayerList("#ct"), getPlayerList("#t")
            for i in cts:
                i.kill()
                es.tell(int(i), "#multi", text("lost"))
开发者ID:StarsGame,项目名称:source_addons,代码行数:31,代码来源:xaobjectives.py


示例7: load

import es
import repeat
import playerlib
from xa import xa

#plugin information
info = es.AddonInfo() 
info.name     = 'High Ping Kicker' 
info.version  = '1.2a'
info.author   = 'SumGuy14'
info.basename = 'xahighpingkick' 

gUserid = {}

# register module with XA
xahighpingkick = xa.register(info.basename)

# Localization helper:
text = xahighpingkick.language.getLanguage()

# make config vars
maxping       = xahighpingkick.setting.createVariable('ping_maxping', 300, 'Maximum ping of a player before they are kicked')
check         = xahighpingkick.setting.createVariable('ping_check', 10, 'How many total times to check the players ping over a period of time before they are kicked')
interval      = xahighpingkick.setting.createVariable('ping_interval', 5, 'How often the players ping is checked, in seconds')
exceedlimit   = xahighpingkick.setting.createVariable('ping_exceedlimit', 3, 'If the players ping is above the max when checked this many times, player will be kicked')

def load():
    """ Make sure all people on the server when this is loaded are not forgotten """
    for userid in playerlib.getUseridList('#human'):
        player_activate({'userid': userid})
开发者ID:StarsGame,项目名称:source_addons,代码行数:30,代码来源:xahighpingkick.py


示例8: load

import es
import playerlib
import popuplib
from xa import xa

#plugin information
info = es.AddonInfo()
info.name           = "Settings"
info.version        = "0.1"
info.author         = "Hunter"
info.basename       = "xasettings"

setting_object = {}

xasettings                  = xa.register(info.basename)
xalanguage                  = xasettings.language.getLanguage()

def load():
    #Load Function for Player Settings for XA.    
    xasettingmenu = popuplib.easymenu("xasettingmenu", "_tempcore", _select_setting)
    xasettingmenu.settitle(xalanguage["player settings"])
    xasettings.addMenu("xasettingmenu", xalanguage["player settings"], "xasettingmenu", "change_playersetting", "UNRESTRICTED")
    xacommand = xasettings.addCommand("settings", _send_menu, "change_playersetting", "UNRESTRICTED")
    xacommand.register(["console","say"])

def unload():
    popuplib.delete("xasettingmenu")
    xasettings.unregister()
    
def _send_menu():
    userid = es.getcmduserid()
开发者ID:StarsGame,项目名称:source_addons,代码行数:31,代码来源:xasettings.py


示例9: load

import es
import popuplib
import playerlib

import cPickle
import os

from xa import xa

info                = es.AddonInfo() 
info.basename       = "xateleport"
info.name           = "Telport"
info.version        = "1.0.1"

xateleport   = xa.register(info.basename)
xalanguage   = xateleport.language.getLanguage() 

xa_anonymous = xateleport.setting.createVariable('teleport_anonymous', 0, "When an admin teleports a player, is it anonymous?")

def load():
    global locations
    strPath = os.path.join(es.getAddonPath("xa"), "data", "locations.db")
    if not os.path.isfile(strPath):
        fStream = open(strPath, "w")
        cPickle.dump({}, fStream)
        fStream.close()
    fStream   = open(strPath, "r")
    locations = cPickle.load(fStream)
    fStream.close()
    
    """ Popup register """
开发者ID:StarsGame,项目名称:source_addons,代码行数:31,代码来源:xateleport.py


示例10: load

import es
import popuplib
import playerlib
from xa import xa

#plugin information
info = es.AddonInfo()
info.name           = "Bot Management"
info.version        = "0.1.1"
info.author         = "GODJonez"
info.basename       = "xabotmanagement"

xabotmanagement     = xa.register(info.basename)
xalanguage          = xabotmanagement.language.getLanguage()

xabmmenu = None
menu_display = {
    'state': False,
    'displays': {},
    }
menu_actions = {}

def load():
    '''
Load Function for Bot Management in XA
Called automatically when loading this script
    '''
    global xabmmenu
    xabmmenu = popuplib.easymenu("xabotmanagementmenu", None, _select_action)
    xabmmenu.settitle(xalanguage["bot management"])
    xabotmanagement.addMenu("xabotmanagementmenu", xalanguage["manage bots"], "xabotmanagementmenu", "manage_bots", "ADMIN")
开发者ID:StarsGame,项目名称:source_addons,代码行数:31,代码来源:xabotmanagement.py


示例11: adverts

# XA Imports
from xa import xa

# ==============================================================================
#   ADDON REGISTRATION
# ==============================================================================
# Register with EventScripts
info = es.AddonInfo()
info.name       = 'Advert' 
info.version    = '1.1' 
info.author     = 'Rio'
info.basename   = 'xaadvert' 

# Register with XA
xaadvert = xa.register(info.basename) 
adverts              = xaadvert.setting.createVariable('adverts', 1, 'Turns adverts on or off') 
time_between_advert  = xaadvert.setting.createVariable('time_between_advert', 120, 'Time between adverts displayed') 
adverts_chat_area    = xaadvert.setting.createVariable('adverts_chat_area', 1, 'Allow adverts in chat area of screen') 
adverts_top_left     = xaadvert.setting.createVariable('adverts_top_left', 1, 'Allow adverts in top left corner of screen') 
advert_col_red       = xaadvert.setting.createVariable('advert_col_red', 0, 'Red component colour of adverts (255 = max)') 
advert_col_green     = xaadvert.setting.createVariable('advert_col_green', 0, 'Green component colour of adverts (255 = max)') 
advert_col_blue      = xaadvert.setting.createVariable('advert_col_blue', 255, 'Blue component colour of adverts (255 = max)') 
advert_dead_only     = xaadvert.setting.createVariable('advert_dead_only', 0, 'Specify if all players or only dead players can see adverts') 
adverts_bottom_area  = xaadvert.setting.createVariable('adverts_bottom_area', 0, 'Show adverts in the hint text area') 

if xa.isManiMode():
   xaadvertlist = xaadvert.configparser.getList('cfg/mani_admin_plugin/adverts.txt', True)
else:
   xaadvertlist = xaadvert.configparser.getList('adverts.txt')
if not xaadvertlist:
开发者ID:StarsGame,项目名称:source_addons,代码行数:30,代码来源:xaadvert.py


示例12: unload

import es
import usermsg
import playerlib
from xa import xa
#plugin information
info = es.AddonInfo() 
info.name     = "Most Destructive" 
info.version  = "1.0" 
info.author   = "SumGuy14"
info.basename = "xamostdestructive"
gPlayerInfo = {}
# Make a global dictionary to track things in
# register module with XA
xamostdestructive = xa.register('xamostdestructive')
xalanguage = xamostdestructive.language.getLanguage()
def unload(): 
    xamostdestructive.unregister() 
def round_start(event_var):
    gPlayerInfo.clear()
    players = playerlib.getUseridList("#all")
    for userid in players:
        gPlayerInfo[userid] = [0,0]
        ####################
        # [0] = Damage done
        # [1] = Kills
        ####################
def player_hurt(event_var):
    attacker = event_var['attacker']
    CheckPlayer(attacker) # Create a spot in memory for player if he doesnt have one
    if event_var['es_attackerteam'] != event_var['es_userteam'] and attacker != event_var['userid'] and es.exists('userid',attacker):
开发者ID:StarsGame,项目名称:source_addons,代码行数:30,代码来源:xamostdestructive.py


示例13: load

    "cs_office",
    "de_aztec",
    "de_cbble",
    "de_chateau",
    "de_dust",
    "de_dust2",
    "de_inferno",
    "de_nuke",
    "de_piranesi",
    "de_port",
    "de_prodigy",
    "de_tides",
    "de_train",
)

xamapmanagement = xa.register("xamapmanagement")
xalanguage = xamapmanagement.language.getLanguage()
xa_announce_setnextmap = xamapmanagement.setting.createVariable(
    "announce_setnextmap", 1, "Announce that a new map has been set in chat to all players?"
)

nextmapvar = es.ServerVar("eventscripts_nextmapoverride")


def load():
    xamapmainmenu = popuplib.easymenu("xamapmainmenu", None, xamapmainmenu_handler)
    xamapmainmenu.settitle(xalanguage["map management"])
    xamapmainmenu.addoption("changemap", xalanguage["change map"])
    xamapmainmenu.addoption("setnextmap", xalanguage["set map"])
    xamapmanagement.addMenu("xamapmainmenu", xalanguage["map management"], "xamapmainmenu", "manage_maps", "ADMIN")
    xamapmanagement.addCommand("nextmap", show_nextmap, "use_nextmap", "UNRESTRICTED").register(("console", "say"))
开发者ID:StarsGame,项目名称:source_addons,代码行数:31,代码来源:xamapmanagement.py


示例14: console

ToDo: 

-Add option in admin menu to cancel RTV 
-Option & command for refreshing variables 
-Admin & Server command to cancel RTV 
-Output to server console (logging excluded) 
-mapchange protection 
-find a better way to open the mapfiles 
-german translation of strings.ini (0.02) 

Notes: 

''' 

xartv = xa.register(info.basename) 

vote_req_time       = xartv.setting.createVariable('vote_time_before_rock_the_vote',           120, "Time before rockthevote can be started after a new map starts in seconds")  
vote_maps           = xartv.setting.createVariable('vote_rock_the_vote_number_of_maps',          6, "Number of random maps chosen from the votelist after nominations have been taken into account.")
vote_req_p          = xartv.setting.createVariable('vote_vote_rock_the_vote_threshold_percent', 60, "Percentage of players on server required to type rockthevote before it starts (min 1, max 100)") 
vote_req_min        = xartv.setting.createVariable('vote_rock_the_vote_threshold_minimum',       4, "Minimum number of players required to type rockthevote before it starts")

if int(vote_req_min) < 1:
    vote_req_min = 4
     
if not 1 < int(vote_req_p) < 100: 
    vote_req_p = 60
     
if int(vote_maps) < 1:
    vote_maps = 6 
开发者ID:StarsGame,项目名称:source_addons,代码行数:29,代码来源:xarockthevote.py


示例15: floodcontrol

import es
import langlib
import os
import playerlib
import time
from xa import xa

#plugin information
info = es.AddonInfo()
info.name       = "Flood Control"
info.version    = "0.2"
info.author     = "Venjax"
info.basename   = "xafloodcontrol"

xafloodcontrol = xa.register(info.basename)
lang_text = xafloodcontrol.language.getLanguage() 
chat_flood_time = xafloodcontrol.setting.createVariable('chat_flood_time', '1.5', "The amount of time (in seconds) that after a player speaks they are restricted from speaking again")
timer = {}

def floodcontrol(userid, message, teamonly):
    #floodcontrol function. Eats spam according to time set in config options.
    global timer
    try:
        if not userid in timer.keys():
         timer[userid] = time.time()
         return userid, message, teamonly
        else:
         if time.time() - float(chat_flood_time) < timer[userid]:
             es.tell(userid, lang_text('chat flood', {}, playerlib.getPlayer(userid).get('lang')))
             xafloodcontrol.logging.log("has been stopped from talking due to flooding, %.2f seconds from last message" % (time.time() - timer[userid] ), userid )
             timer[userid] = time.time()
开发者ID:StarsGame,项目名称:source_addons,代码行数:31,代码来源:xafloodcontrol.py


示例16: load

import os
import popuplib
import playerlib
import langlib
from xa import xa

playerlimit = {}

#plugin information
info = es.AddonInfo()
info.name           = "Sounds"
info.version        = "0.2"
info.author         = "Hunter"
info.basename       = "xasounds"

xasounds                            = xa.register(info.basename)
xalanguage                          = xasounds.language.getLanguage()
xaplayerdata_sounds                 = xasounds.playerdata.createUserSetting('sounds')

if xa.isManiMode():
    xasoundslist                    = xasounds.configparser.getAliasList('cfg/mani_admin_plugin/soundlist.txt', True)
else:
    xasoundslist                    = xasounds.configparser.getAliasList('soundlist.txt')

sounds_per_round                    = xasounds.setting.createVariable('sounds_per_round', '0', 'Number of sounds a regulary player can play in the course of a round')
sounds_filter_if_dead               = xasounds.setting.createVariable('sounds_filter_if_dead', '0', '1 = If a player is dead then only other dead players will hear it')
sounds_download                     = xasounds.setting.createVariable('sounds_auto_download', '0', '0 = Don\'t auto download files to client, 1 = automatically download files to client')
sounds_settings                     = xasounds.setting.createVariable('player_settings_sounds', '1', '0 = player settings default to off, 1 = player settings default to on')

def load():
    global mainmenu
开发者ID:StarsGame,项目名称:source_addons,代码行数:31,代码来源:xasounds.py


示例17: load

# ./xa/modules/xathetime/xathetime.py

import es
import time
from xa import xa

#plugin information
info = es.AddonInfo()
info.name       = "The Time"
info.version    = "1.0"
info.author     = "Unknown"
info.basename   = "xathetime"

xathetime               = xa.register(info.basename)
adjust_time             = xathetime.setting.createVariable('adjust_time', 0, 'Minutes to add to server clock')
military_time           = xathetime.setting.createVariable('military_time', 0, '0 = use 12hr format, 1 = use 24hr format')
thetime_player_only     = xathetime.setting.createVariable('thetime_player_only', 1, '0 = time is sent to all players on request, 1 = time is only sent to the requesting player')
thetime_timezone        = xathetime.setting.createVariable('thetime_timezone', 'GMT', 'Timezone to display -- DOES NOT AFFECT TIME DISPLAYED')


def load():
    """ """
    xathetime.addCommand('thetime', show_time, 'display_thetime', 'UNRESTRICTED').register(('console', 'say'))


def unload():
    """ """
    xathetime.unregister()


def show_time():
开发者ID:StarsGame,项目名称:source_addons,代码行数:31,代码来源:xathetime.py


示例18: Check

            self.remote_version = u.read()
            self.last = time.time()
            logging.log("xaupdate", "Retrieved latest version information from %s" % self.url)
            logging.log("xaupdate", "Latest version is %s" % self.remote_version)
            if xa.info.version != self.remote_version:
                logging.log("xaupdate", "There is a newer version of XA available")
            else:
                logging.log("xaupdate", "XA is up to date")
        except HTTPError:
            # error
            logging.log("xaupdate", "Unable to download version information")


check = Check()

xamodule = xa.register(info.basename)
xalanguage = xamodule.language.getLanguage()


def load():
    # if we are loading xaupdate at the same time as server boot then we can safely run a check
    if es.ServerVar("eventscripts_currentmap") != "":
        es_map_start({})
    else:
        # otherwise just create a dummy menu
        create_menu()
    xamodule.addMenu("xaupdate_menu", xalanguage["xaupdate"], "xaupdate_menu", "xaupdate_menu", "ADMIN")


def es_map_start():
    if check.last or (time.time() - last_check) > update_every:
开发者ID:StarsGame,项目名称:source_addons,代码行数:31,代码来源:xaupdate.py


示例19: load

import es
from xa import xa

#plugin information
info = es.AddonInfo() 
info.name     = "Admin rcon" 
info.version  = "1.0" 
info.author   = "McFly"
info.basename = "xarcon"

#######################################
# MODULE SETUP
# Register the module
# this is a global reference to our module
xarcon = xa.register(info.basename)


#######################################
# GLOBALS
# We initialize our general global data here.

list_round_rcon = []
list_map_rcon = []


#######################################
# LOAD AND UNLOAD
# Formal system registration and unregistration
def load():
    """Registers the xarcon commands"""
开发者ID:StarsGame,项目名称:source_addons,代码行数:30,代码来源:xarcon.py


示例20:

 -- OY4 --
 * [FIX] silly bug (my fault) where a text sting in the mani cfg was stripped of spaces.. duh!
 -- OY3 --
 * [FIX] reserved slot failing when a player joined
 * [FIX] a missing bracket
 * [TEST] getting it working some more
 -- OY2 --
 * [FIX] a load of dbg msgs
 * [+] cleaned the code slightly
 -- OY1  -- OY
 * [+] released

'''

# Register the module
xareserveslots = xa.register(info.basename)

# Get the lang file
text = xareserveslots.language.getLanguage()

# load the list of reserved players
if xa.isManiMode():
    xaReservedList = xareserveslots.configparser.getList("cfg/mani_admin_plugin/reserveslots.txt", True)
else:
    xaReservedList = None

if not xaReservedList:
    xaReservedList = xareserveslots.configparser.getList("reserved_slots_list.txt")
else:
    xaReservedList.extend(xareserveslots.configparser.getList("reserved_slots_list.txt"))
开发者ID:StarsGame,项目名称:source_addons,代码行数:30,代码来源:xareserveslots.py



注:本文中的xa.xa.register函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python layout.render_field函数代码示例发布时间:2022-05-26
下一篇:
Python session.getterminal函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap