Advertisement
tjone270

floordamage vote plugin

Jan 3rd, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import minqlx
  2.  
  3. class custom_votes(minqlx.Plugin):
  4.    
  5.     def __init__(self):
  6.         self.add_hook("vote_called", self.handle_vote_called)
  7.  
  8.     def handle_vote_called(self, caller, vote, args):
  9.         if not (self.get_cvar("g_allowSpecVote", bool)):
  10.             caller.tell("You are not allowed to call a vote as spectator.")
  11.        
  12.         if vote.lower() == "floordamage":
  13.             # enables the '/cv floordamage [on/off]' command
  14.             if args.lower() == "off":
  15.                 self.callvote("set g_forceDmgThroughSurface 0", "damage through floors/surfaces: off")
  16.                 self.msg("{}^7 called a vote.".format(caller.name))
  17.                 return minqlx.RET_STOP_ALL
  18.             elif args.lower() == "on":
  19.                 self.callvote("set g_forceDmgThroughSurface 1", "damage through floors/surfaces: on")
  20.                 self.msg("{}^7 called a vote.".format(caller.name))
  21.                 return minqlx.RET_STOP_ALL
  22.             else:
  23.                 caller.tell("^2/cv floordamage [on/off]^7 is the usage for this callvote command.")
  24.                 return minqlx.RET_STOP_ALL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement