Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ########################
- #####WAIT CT REWRITTEN##
- ##### BY JACKMASTER#####
- ########################
- import es
- import cPickle
- import os
- addonpath = es.getAddonPath("CTWait").replace("\\", "/")
- dbpath = os.path.join(addonpath, "CTWait.db")
- need_rounds = 50
- rounds = {}
- try:
- rounds = cPickle.load(open(dbpath, "rb"))
- except:
- pass
- def round_start(ev):
- for p in es.getUseridList():
- sid = es.getplayersteamid(p)
- t = es.getplayerteam(p)
- if not sid in ['BOT', 'STEAM_ID_LAN', 'STEAM_ID_PENDING']:
- if t == 3:
- if not round.has_key(sid):
- rounds[sid] = {}
- if not rounds[sid].has_key('roundcounter']:
- rounds[sid]['roundcounter'] = 0
- rounds[sid]['roundcounter'] += 1
- cPickle.dump(rounds, open(dbpath, "wb"))
- def player_team(ev):
- steamid = ev['es_steamid']
- newteam = ev['team']
- change_allowed = False
- if newteam == '3':
- if rounds.has_key(steamid):
- if rounds[steamid].has_key('roundcounter'):
- if rounds[steamid]['roundcounter'] >= need_rounds:
- change_allowed = True
- if not change_allowed:
- es.tell(userid, '#multi', 'du kannst noch nicht zu CT gehen')
- def unload():
- cPickle.dump(rounds, open(dbpath, "wb"))
- ########################
- #####WAIT CT REWRITTEN##
- ##### BY JACKMASTER#####
- ########################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement