当前位置: 首页>>代码示例>>Python>>正文


Python minqlx.set_cvar函数代码示例

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


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

示例1: instagib

 def instagib(self, value):
     if isinstance(value, bool):
         minqlx.set_cvar("g_instaGib", str(int(value)))
     elif value == 0 or value == 1:
         minqlx.set_cvar("g_instaGib", str(value))
     else:
         raise ValueError("instagib needs to be 0, 1, or a bool.")
开发者ID:JoolsJealous,项目名称:minqlx,代码行数:7,代码来源:_game.py

示例2: loadout

 def loadout(self, value):
     if isinstance(value, bool):
         minqlx.set_cvar("g_loadout", str(int(value)))
     elif value == 0 or value == 1:
         minqlx.set_cvar("g_loadout", str(value))
     else:
         raise ValueError("loadout needs to be 0, 1, or a bool.")
开发者ID:JoolsJealous,项目名称:minqlx,代码行数:7,代码来源:_game.py

示例3: tags

 def tags(self, new_tags):
     if isinstance(new_tags, str):
         minqlx.set_cvar("sv_tags", new_tags)
     elif hasattr(new_tags, "__iter__"):
         minqlx.set_cvar("sv_tags", ",".join(new_tags))
     else:
         raise ValueError("tags need to be a string or an iterable returning strings.")
开发者ID:JoolsJealous,项目名称:minqlx,代码行数:7,代码来源:_game.py

示例4: set_initial_fps

 def set_initial_fps(self, cvarval):
     if (cvarval != STD_SVFPS):
         if (self.check_value(cvarval, minqlx.CHAT_CHANNEL)):
             minqlx.set_cvar("sv_fps", str(cvarval), -1)
         else:
             self.msg("Will not set sv_fps to value of qlx_svfps as the latter contains an incompatible value.")
     else:
         pass 
开发者ID:BarelyMiSSeD,项目名称:Quake-Live,代码行数:8,代码来源:sv_fps.py

示例5: game_countdown

    def game_countdown(self):
        self.play_sound("sound/items/protect3.ogg")
        minqlx.set_cvar("g_infiniteAmmo", "0")
        if self.game.type_short != "duel":
            for p in self.players():
                p.noclip = True
                if self.purgersBirthday:
                    p.powerups(quad=10)
                else:
                    p.powerups(battlesuit=10)

        self.donation_message("Consider ^2!donating^7 to ^4The Purgery^7, it would really help a lot.")
开发者ID:TomTec-Solutions,项目名称:QL-Server-Config,代码行数:12,代码来源:tomtec_logic.py

示例6: cmd_svfps

    def cmd_svfps(self, player, msg, channel):
        if len(msg) < 2:
            return minqlx.RET_USAGE

        try:
            sv_fps = int(msg[1])
        except ValueError:
            channel.reply("You must specify a positive integer greater than or equal to {}.".format(STD_SVFPS))
            return minqlx.RET_STOP

        if (self.check_value(sv_fps, channel)):
            minqlx.set_cvar("sv_fps", str(sv_fps), -1)
            channel.reply("sv_fps is now set to {}.".format(sv_fps))
开发者ID:BarelyMiSSeD,项目名称:Quake-Live,代码行数:13,代码来源:sv_fps.py

示例7: set_cvar

    def set_cvar(cls, name, value, flags=0):
        """Sets a cvar. If the cvar exists, it will be set as if set from the console,
        otherwise create it.

        :param name: The name of the cvar.
        :type name: str
        :param value: The value of the cvar.
        :type value: Anything with an __str__ method.
        :param flags: The flags to set if, and only if, the cvar does not exist and has to be created.
        :type flags: int
        :returns: True if a new cvar was created, False if an existing cvar was set.
        :rtype: bool

        """
        if cls.get_cvar(name) is None:
            minqlx.set_cvar(name, value, flags)
            return True
        else:
            minqlx.console_command("{} \"{}\"".format(name, value))
            return False
开发者ID:MinoMino,项目名称:minqlx,代码行数:20,代码来源:_plugin.py

示例8: set_cvar_limit

    def set_cvar_limit(cls, name, value, minimum, maximum, flags=0):
        """Sets a cvar with upper and lower limits. If the cvar exists, it will be set
        as if set from the console, otherwise create it.

        :param name: The name of the cvar.
        :type name: str
        :param value: The value of the cvar.
        :type value: int, float
        :param minimum: The minimum value of the cvar.
        :type value: int, float
        :param maximum: The maximum value of the cvar.
        :type value: int, float
        :param flags: The flags to set if, and only if, the cvar does not exist and has to be created.
        :type flags: int
        :returns: True if a new cvar was created, False if an existing cvar was set.
        :rtype: bool

        """
        if cls.get_cvar(name) is None:
            minqlx.set_cvar(name, value, flags)
            return True
        else:
            minqlx.console_command("{} \"{}\"".format(name, value))
            return False
开发者ID:MinoMino,项目名称:minqlx,代码行数:24,代码来源:_plugin.py

示例9: fraglimit

 def fraglimit(self, new_limit):
     minqlx.set_cvar("fraglimit", str(new_limit))
开发者ID:JoolsJealous,项目名称:minqlx,代码行数:2,代码来源:_game.py

示例10: set_cvar_once

def set_cvar_once(name, value, flags=0):
    if minqlx.get_cvar(name) is None:
        minqlx.set_cvar(name, value, flags)
        return True

    return False
开发者ID:MinoMino,项目名称:minqlx,代码行数:6,代码来源:_core.py

示例11: map_load

 def map_load(self, mapname, factory):
     # turn on infinite ammo for warm-up
     minqlx.set_cvar("g_infiniteAmmo", "1")
     self.readyPlayers = []
开发者ID:TomTec-Solutions,项目名称:QL-Server-Config,代码行数:4,代码来源:tomtec_logic.py

示例12: teamsize

 def teamsize(self, new_size):
     minqlx.set_cvar("teamsize", str(new_size))
开发者ID:JoolsJealous,项目名称:minqlx,代码行数:2,代码来源:_game.py

示例13: hostname

 def hostname(self, value):
     minqlx.set_cvar("sv_hostname", str(value))
开发者ID:JoolsJealous,项目名称:minqlx,代码行数:2,代码来源:_game.py

示例14: capturelimit

 def capturelimit(self, new_limit):
     minqlx.set_cvar("capturelimit", str(new_limit))
开发者ID:JoolsJealous,项目名称:minqlx,代码行数:2,代码来源:_game.py

示例15: scorelimit

 def scorelimit(self, new_limit):
     minqlx.set_cvar("scorelimit", str(new_limit))
开发者ID:JoolsJealous,项目名称:minqlx,代码行数:2,代码来源:_game.py


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