import es

def player_death(event_var):
    userid = int(event_var['userid'])
    attacker = int(event_var['attacker'])
    ateam = int(es.getplayerteam(attacker))
    uteam = int(es.getplayerteam(userid))
    if not attacker:
        es.server.queuecmd('score add %s +1'%userid) 
    if ateam == uteam:
        es.server.queuecmd('score add %s +1'%attacker)