# Fragter plugin for Deathrun Mod v 1.5
# Visit our DeathRun Server 188.134.21.171:27015
# Visit our site www.tk-portal.ru

import es

def player_death(event_var):
    userid = int(event_var['userid'])
    attacker = int(event_var['attacker'])
    if es.getlivingplayercount(3) < 1 and es.getlivingplayercount(2) > 0:
        if int(es.getplayerteam(attacker)) != 3:
            for userid in es.getUseridList():
                if es.getplayerteam(userid) == 2 and not es.getplayerprop(userid, 'CBasePlayer.pl.deadflag'):
                    es.server.queuecmd('score add %s +1'%userid)