Beispiel #1
0
def issueDamageUpdate():
    for cn in acserver.getClients():
        cl = acserver.getClient(cn)
        if cl == None:
            continue
            
        if cl['state'] == CS_ALIVE:
            acserver.damageClient(cn,cn,max(2,int(cl['health']*healthmod)))
        
        acserver.setClient(cn,points=cl['health'])
Beispiel #2
0
def clientdamage(acn, tcn, gun, damage, gib):
    global enabled, clientHealth
    if not enabled:
        return False
        
    if acn == tcn:
        return False
    
    acl = acserver.getClient(acn)
    addedhp = 0
    if gun == GUN_KNIFE:
        tcl = acserver.getClient(tcn)
        if tcl['health'] > 200: #If the health is more than 200, we can have a zap
            acserver.killClient(acn,tcn,1,GUN_KNIFE)
            addedhp = tcl['health']/damagemod
        else:
            acserver.killClient(acn,acn,1,GUN_KNIFE)
    else:
        addedhp = damage/damagemod
    if acl['state'] == CS_ALIVE:
        acserver.setClient(acn,health=acl['health']+addedhp)
        acserver.damageClient(acn,acn,0)
        return False