Advertisement
tjone270

infiniteammo.py

Oct 8th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. # Thomas R Jones (tjone270) - 08/10/2016
  2. import minqlx
  3.  
  4. class infiniteammo(minqlx.Plugin):
  5.     def __init__(self):
  6.         self.add_hook("map", self.handle_map)
  7.         self.add_hook("game_countdown", self.handle_game_countdown)
  8.  
  9.         self.set_cvar_once("qlx_infiniteAmmo", "0") # 0=normal ammo, 1=always, 2=during warmup only
  10.        
  11.     @minqlx.next_frame  
  12.     def handle_map(self, mapname, factory):
  13.         # turn on infinite ammo for warm-up
  14.         if self.get_cvar("qlx_infiniteAmmo", int) != 0:
  15.             self.set_cvar("g_infiniteAmmo", "1")
  16.  
  17.     def handle_game_countdown(self):
  18.         if (self.get_cvar("qlx_infiniteAmmo", int) == 2) or (self.get_cvar("qlx_infiniteAmmo", int) == 0):
  19.             self.set_cvar("g_infiniteAmmo", "0")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement