Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 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') es.getplayercount(COLORS2TEAM[color]['number']):
  12.         return playerlib.getPlayerList('#' + COLORS2TEAM[color]['team']).index
  13.     return INDEX_GREY if color == 'grey' else INDEX_LIGHTGREEN
  14.    
  15.    
  16. """
  17.     getIndex('lightgreen|grey|red|blue')
  18.  
  19.     @RETURN int index - Return a index (to use with usermsg!) if it can provided, else 0 (=lightgreen) by default
  20. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement