import es, gamethread, random, playerlib, math difficulty = 'hard' round_started = 0 settings = { 'easy':{ 'spawn time maximum': 60, 'spawn time minimum':45, 'mob size': 10 }, 'normal':{ 'spawn time maximum': 50, 'spawn time minimum':40, 'mob size': 20 }, 'hard':{ 'spawn time maximum': 40, 'spawn time minimum':35, 'mob size': 20 }, 'expert':{ 'spawn time maximum': 30, 'spawn time minimum':30, 'mob size': 30 } } def load(): gamethread.cancelDelayed('spawn') global round_started round_started = 0 es.msg('[MAD MOB MOD] Loaded') def player_spawn(ev): es.tell(ev['userid'], 'This server uses [MAD MOB MOD]') def player_left_start_area(ev): global round_started, difficulty difficulty = str(es.ServerVar('z_difficulty')).lower() round_started = 1 es.msg('[MAD MOB MOD] Left Safe Room') gamethread.delayedname(random.randint(settings[difficulty]['spawn time minimum'], settings[difficulty]['spawn time maximum']), 'spawn', spawn) def door_open(ev): global round_started if not round_started: round_started = 1 es.msg('[MAD MOB MOD] Left Safe Room') gamethread.delayedname(random.randint(settings[difficulty]['spawn time minimum'], settings[difficulty]['spawn time maximum']), 'spawn', spawn) def round_end(ev): global round_started round_started = 0 gamethread.cancelDelayed('spawn') es.msg('[MAD MOB MOD] GooD GamE') def spawn(): for userid in es.getUseridList(): if not int(es.getplayerprop(userid, 'CBasePlayer.pl.deadflag')) and int(es.getplayerteam(userid)) == 2: player = userid x,y,z = es.getplayerlocation(player) es.flags('remove', 'cheat', 'z_spawn') es.flags('remove', 'cheat', 'z_spawn_const_pos') point = [x,y,z + 50] es.ServerVar('z_spawn_const_pos').set('%s %s %s'%tuple(point)) x = 0 while x < settings[difficulty]['mob size']: x += 1 es.sexec(player, 'z_spawn') if x == settings[difficulty]['mob size']: es.flags('add', 'cheat', 'z_spawn') es.flags('add', 'cheat', 'z_spawn_const_pos') gamethread.delayedname(random.randint(settings[difficulty]['spawn time minimum'], settings[difficulty]['spawn time maximum']), 'spawn', spawn) def unload(): gamethread.cancelDelayed('spawn')