Advertisement
Brainsucker

Untitled

Oct 9th, 2011
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.34 KB | None | 0 0
  1. import es
  2. import services
  3.  
  4. #Pfad zum Sound angeben: (.mp3 oder .wav)
  5. admin_sound_path = 'meinordner/meinsound.mp3'
  6.  
  7.  
  8.  
  9. def download():
  10.         es.stringtable('downloadables', 'sound/%s' % admin_sound_path)
  11.  
  12.  
  13. def load():
  14.         global auth_service
  15.        
  16.         if services.isRegistered('auth'):
  17.                 auth_service = services.use('auth')
  18.                 auth_service.registerCapability('admin_join_sound', auth_service.ADMIN)
  19.                 download()
  20.                
  21.                
  22. def player_activate(ev):
  23.         steamid = ev['es_steamid']
  24.         if auth_service.isIdAuthorized(steamid, 'admin_join_sound'):
  25.                 for player in es.getUseridList():
  26.                         sid = es.getplayersteamid(player)
  27.                         if sid != steamid:
  28.                                 es.playsound(player, admin_sound_path, 1.0)
  29.                                
  30.                 es.msg('#multi', '#green[ADMIN] #lightgreen[%s] #defaultist dem Spiel beigetreten.' % (ev['es_username']))
  31. def player_disconnect(ev):
  32.         steamid = ev['networkid']
  33.         if auth_service.isIdAuthorized(steamid, 'admin_join_sound'):
  34.                 es.msg('#multi', '#green[ADMIN] #lightgreen[%s] #defaulthat das Spiel verlassen.' % (ev['es_username']))
  35.                                
  36.                        
  37.        
  38.        
  39. def es_map_start(ev):
  40.         download()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement