Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import minqlx
- class custom_votes(minqlx.Plugin):
- def __init__(self):
- self.add_hook("vote_called", self.handle_vote_called)
- def handle_vote_called(self, caller, vote, args):
- if not (self.get_cvar("g_allowSpecVote", bool)):
- caller.tell("You are not allowed to call a vote as spectator.")
- if vote.lower() == "floordamage":
- # enables the '/cv floordamage [on/off]' command
- if args.lower() == "off":
- self.callvote("set g_forceDmgThroughSurface 0", "damage through floors/surfaces: off")
- self.msg("{}^7 called a vote.".format(caller.name))
- return minqlx.RET_STOP_ALL
- elif args.lower() == "on":
- self.callvote("set g_forceDmgThroughSurface 1", "damage through floors/surfaces: on")
- self.msg("{}^7 called a vote.".format(caller.name))
- return minqlx.RET_STOP_ALL
- else:
- caller.tell("^2/cv floordamage [on/off]^7 is the usage for this callvote command.")
- return minqlx.RET_STOP_ALL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement