import es, playerlib, gamethread ### Start Config ### zombies_only = 0 # 1/0 if in use for a zombie mod srever, if 1 only zombies will have their HP shown. # Ignore this if you have the following cvar 0 zombie_spawn_min = 30 # The amount of seconds you have in zombiemod.cfg for zombie_spawn_min for the first zombie to spawn ### End Config ### zombie_spawned = 0 def load(): es.msg('#multi', '#green[#lightgreenBSH#green]: Loaded') es.msg('#multi', '#grenYour Health will now be shown on the #lightgreenCash Bar') es.addons.registerClientCommandFilter(change_health) def unload(): es.msg('#multi', '#green[#lightgreenBSH#green]: Unloaded') es.addons.unregisterClientCommandFilter(change_health) def player_hurt(event_var): if iszombie(event_var['userid']) or not zombies_only: playerlib.getPlayer(event_var['userid']).set('cash', playerlib.getPlayer(event_var['userid']).get('health')) def player_spawn(event_var): if iszombie(event_var['userid']) or not zombies_only: playerlib.getPlayer(event_var['userid']).set('cash', playerlib.getPlayer(event_var['userid']).get('health')) def change_health(userid, args): if args[0].lower() == 'buy': if iszombie(userid) or not zombies_only: gamethread.delayed(0, playerlib.getPlayer(userid).set, ('cash', playerlib.getPlayer(userid).get('health'))) return True def round_start(ev): global zombie_spawned gamethread.cancelDelayed('turn_off_zombie') gamethread.delayedname(zombie_spawn_min, 'turn_off_zombie', make_zombie) zombie_spawned = 0 def make_zombie(): global zombie_spawned zombie_spawned = 1 def iszombie(userid): p = playerlib.getPlayer(userid) if not zombie_spawned: return False if p.get('teamid') == 2: if p.get('primary') == '0' and p.get('secondary') == '0': return True return False