Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import es
- import services
- #Pfad zum Sound angeben: (.mp3 oder .wav)
- admin_sound_path = 'meinordner/meinsound.mp3'
- def download():
- es.stringtable('downloadables', 'sound/%s' % admin_sound_path)
- def load():
- global auth_service
- if services.isRegistered('auth'):
- auth_service = services.use('auth')
- auth_service.registerCapability('admin_join_sound', auth_service.ADMIN)
- download()
- def player_activate(ev):
- steamid = ev['es_steamid']
- if auth_service.isIdAuthorized(steamid, 'admin_join_sound'):
- for player in es.getUseridList():
- sid = es.getplayersteamid(player)
- if sid != steamid:
- es.playsound(player, admin_sound_path, 1.0)
- es.msg('#multi', '#green[ADMIN] #lightgreen[%s] #defaultist dem Spiel beigetreten.' % (ev['es_username']))
- def player_disconnect(ev):
- steamid = ev['networkid']
- if auth_service.isIdAuthorized(steamid, 'admin_join_sound'):
- es.msg('#multi', '#green[ADMIN] #lightgreen[%s] #defaulthat das Spiel verlassen.' % (ev['es_username']))
- def es_map_start(ev):
- download()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement