def safeRemove(index):
    """
    Ensures that an entity exists before safely removing it.
    
    @pararm int index The entity ID of the object to remove
    """
    if index in es.createentitylist() and index:
        es.remove(index)
Exemple #2
0
def item_pickup(ev):
    userid = int(ev['userid'])
    weapon = str(ev['item'])
    if weapon == "c4":
        es.remove("weapon_c4")
    else:
        es.playsound(userid, "zeisenproject/the-killers/sounds/sndPickUpWeapon.wav", 1.0)
        index = getweaponindex(userid, weapon)
        r,g,b,a = getentitycolor(index)
        if a == 255:
            est.setclipammo(userid, weapon, 255)
            est.setammo(userid, weapon, getmaxclipammo(weapon))
            est.setentitycolor(index, r, g, b, 254)
    def removeEntity(self, entity):
        """
        Remove a specific entity and cancel the delay

        @PARAM entity - the entity to remove
        """
        if entity in self.entities:
            del self.entities[entity]
            gamethread.cancelDelayed("sourcerpg_smokegrenade_entity%s" % entity)

            """ Remove the entity if it exists """
            if entity in es.createentitylist("smokegrenade_projectile"):
                es.remove(entity)
Exemple #4
0
    def removeEntity(self, entity):
        """
        Remove a specific entity and cancel the delay

        @PARAM entity - the entity to remove
        """
        if entity in self.entities:
            del self.entities[entity]
            gamethread.cancelDelayed("sourcerpg_smokegrenade_entity%s" %
                                     entity)
            """ Remove the entity if it exists """
            if entity in es.createentitylist("smokegrenade_projectile"):
                es.remove(entity)
Exemple #5
0
def item_pickup(ev):
    if (ev['item'] == "c4"): es.remove("weapon_c4")
    if (ev['es_userteam'] == "2"):
        if ev['item'] != "knife" and ev['item'] != "player_weaponstrip":
            es.server.queuecmd("es_xgive %s %s" %
                               (ev['userid'], "player_weaponstrip"))
            es.server.queuecmd("es_xfire %s player_weaponstrip strip" %
                               (ev['userid']))
            es.server.queuecmd("es_xfire %s player_weaponstrip kill" %
                               (ev['userid']))
            es.server.queuecmd("es_xgive %s %s" %
                               (ev['userid'], "weapon_knife"))
    if (ev['es_userteam'] == "3"):
        ammo(ev['userid'])
Exemple #6
0
def item_pickup(ev):
    userid = int(ev['userid'])
    weapon = str(ev['item'])
    if weapon == "c4":
        es.remove("weapon_c4")
    else:
        es.playsound(userid,
                     "zeisenproject/the-killers/sounds/sndPickUpWeapon.wav",
                     1.0)
        index = getweaponindex(userid, weapon)
        r, g, b, a = getentitycolor(index)
        if a == 255:
            est.setclipammo(userid, weapon, 255)
            est.setammo(userid, weapon, getmaxclipammo(weapon))
            est.setentitycolor(index, r, g, b, 254)
Exemple #7
0
def remove(argv):
    es.remove(*argv)
def remove(argv):
  es.remove(*argv)