Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. import es
  2. import playerlib
  3.  
  4. INDEX_GREY       = -1
  5. INDEX_LIGHTGREEN = 0
  6.  
  7. COLORS2TEAM = {'red':{'team':'t', 'number':2}, 'blue':{'team':'ct', 'number':3}}
  8.  
  9. def getIndex(color='lightgreen'):
  10.     color = color.lower().strip('"')
  11.     if color in ('red', 'blue'):
  12.         if es.getplayercount(COLORS2TEAM[color]['number']):
  13.             return playerlib.getPlayerList('#' + COLORS2TEAM[color]['team']).index
  14.     return INDEX_GREY if color == 'grey' else INDEX_LIGHTGREEN
  15.    
  16.    
  17. """
  18.     getIndex('lightgreen|grey|red|blue')
  19.  
  20.     @RETURN int index - Return a index (to use with usermsg!) if it can provided, else 0 (=lightgreen) by default
  21. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement