本文整理汇总了Python中minqlx.set_cvar函数的典型用法代码示例。如果您正苦于以下问题:Python set_cvar函数的具体用法?Python set_cvar怎么用?Python set_cvar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_cvar函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: maxclients
def maxclients(self, new_limit):
minqlx.set_cvar("sv_maxclients", str(new_limit))
开发者ID:JoolsJealous,项目名称:minqlx,代码行数:2,代码来源:_game.py
示例17: cmd_ruleset
def cmd_ruleset(self, player, msg, channel):
if len(msg) < 2:
return minqlx.RET_USAGE
if msg[1].lower() == "pql":
minqlx.set_cvar("pmove_airControl", "1")
minqlx.set_cvar("pmove_rampJump", "1")
minqlx.set_cvar("weapon_reload_rg", "1200")
minqlx.set_cvar("pmove_weaponRaiseTime", "10")
minqlx.set_cvar("pmove_weaponDropTime", "10")
minqlx.set_cvar("g_damage_lg", "7")
minqlx.set_cvar("dmflags", "60")
if self.game.type_short == "ca":
minqlx.set_cvar("g_startingHealth", "200")
minqlx.set_cvar("g_startingArmor", "200")
minqlx.console_command("map_restart")
self.msg("PQL ruleset is now set.")
if msg[1].lower() == "vql":
minqlx.set_cvar("pmove_airControl", "0")
minqlx.set_cvar("pmove_rampJump", "0")
minqlx.set_cvar("weapon_reload_rg", "1500")
minqlx.set_cvar("pmove_weaponRaiseTime", "200")
minqlx.set_cvar("pmove_weaponDropTime", "200")
minqlx.set_cvar("g_damage_lg", "6")
if self.game.type_short == "ca":
minqlx.set_cvar("dmflags", "28")
else:
minqlx.console_command("reset dmflags")
minqlx.console_command("reset g_startingHealth")
minqlx.console_command("reset g_startingArmor")
minqlx.console_command("map_restart")
self.msg("VQL ruleset is now set.")
开发者ID:alpi-ua,项目名称:Quake-Live,代码行数:33,代码来源:custom_votes.py
示例18: timelimit
def timelimit(self, new_limit):
minqlx.set_cvar("timelimit", str(new_limit))
开发者ID:JoolsJealous,项目名称:minqlx,代码行数:2,代码来源:_game.py
示例19: cmd_excessive_weaps
def cmd_excessive_weaps(self, player, msg, channel):
if len(msg) < 2:
return minqlx.RET_USAGE
if msg[1] == "on":
minqlx.set_cvar("weapon_reload_sg", "200")
minqlx.set_cvar("weapon_reload_rl", "200")
minqlx.set_cvar("weapon_reload_rg", "50")
minqlx.set_cvar("weapon_reload_prox", "200")
minqlx.set_cvar("weapon_reload_pg", "40")
minqlx.set_cvar("weapon_reload_ng", "800")
minqlx.set_cvar("weapon_reload_mg", "40")
minqlx.set_cvar("weapon_reload_hmg", "40")
minqlx.set_cvar("weapon_reload_gl", "200")
minqlx.set_cvar("weapon_reload_gauntlet", "100")
minqlx.set_cvar("weapon_reload_cg", "30")
minqlx.set_cvar("weapon_reload_bfg", "75")
minqlx.set_cvar("qlx_excessive", "1")
self.msg("Excessive weapons are enabled.")
if msg[1] == "off":
minqlx.console_command("reset weapon_reload_sg")
minqlx.console_command("reset weapon_reload_rl")
if (minqlx.get_cvar("pmove_airControl")) == "1":
minqlx.set_cvar("weapon_reload_rg", "1200")
else:
minqlx.console_command("reset weapon_reload_rg")
minqlx.console_command("reset weapon_reload_prox")
minqlx.console_command("reset weapon_reload_pg")
minqlx.console_command("reset weapon_reload_ng")
minqlx.console_command("reset weapon_reload_mg")
minqlx.console_command("reset weapon_reload_hmg")
minqlx.console_command("reset weapon_reload_gl")
minqlx.console_command("reset weapon_reload_gauntlet")
minqlx.console_command("reset weapon_reload_cg")
minqlx.console_command("reset weapon_reload_bfg")
minqlx.set_cvar("qlx_excessive", "0")
self.msg("Excessive weapons are disabled.")
开发者ID:alpi-ua,项目名称:Quake-Live,代码行数:37,代码来源:custom_votes.py
示例20: roundtimelimit
def roundtimelimit(self, new_limit):
minqlx.set_cvar("roundtimelimit", str(new_limit))
开发者ID:JoolsJealous,项目名称:minqlx,代码行数:2,代码来源:_game.py
注:本文中的minqlx.set_cvar函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论