Example #1
0
def remove_multi_level(userid):
    # Check validity
    if es.exists('userid', userid):

        # Reset player speed and gravity
        getPlayer(userid).speed = 1.0
        gravity.removeGravityChange(userid)

        # Get the Player() object
        ggPlayer = Player(userid)

        # Remove the ent indexes
        while ggPlayer.multiLevelEntities:
            ind = ggPlayer.multiLevelEntities.pop()

            # Create entitylists for the sparks
            validIndexes = es.getEntityIndexes('env_spark')

            # If the saved index of the index given to the player still exists
            #   remove it.
            if ind in validIndexes:
                spe.removeEntityByIndex(ind)

        # Stop the sound
        es.stopsound(userid, currentMultiLevel[userid])

        # Remove the player from the current multi level list
        del currentMultiLevel[userid]
Example #2
0
def remove_multi_level(userid):
    # Check validity
    if es.exists('userid', userid):

        # Reset player speed and gravity
        getPlayer(userid).speed = 1.0
        gravity.removeGravityChange(userid)

        # Get the Player() object
        ggPlayer = Player(userid)

        # Remove the ent indexes
        while ggPlayer.multiLevelEntities:
            ind = ggPlayer.multiLevelEntities.pop()

            # Create entitylists for the sparks
            validIndexes = es.getEntityIndexes('env_spark')

            # If the saved index of the index given to the player still exists
            #   remove it.
            if ind in validIndexes:
                spe.removeEntityByIndex(ind)

        # Stop the sound
        es.stopsound(userid, currentMultiLevel[userid])

        # Remove the player from the current multi level list
        del currentMultiLevel[userid]
Example #3
0
def round_start(event_var):
    '''Called at the start of every round'''

    # Remove weapons from the map
    do_not_strip = [(x.strip() if x.strip().startswith('weapon_') else
                     'weapon_%s' % x.strip())
                    for x in str(gg_map_strip_exceptions).split(',')
                    if x.strip() != '']

    for weapon in getWeaponList('#all'):
        # Make sure that the admin doesn't want the weapon left on the map
        if weapon in do_not_strip:
            continue

        # Remove all weapons of this type from the map
        for index in weapon.indexlist:
            # If the weapon has an owner, stop here
            if es.getindexprop(index, 'CBaseEntity.m_hOwnerEntity') != -1:
                continue

            removeEntityByIndex(index)

    # Equip players with a knife and
    # possibly item_kevlar or item_assaultsuit
    equip_player()
Example #4
0
 def removeSecondary(self):
     """Safely removes the secondary weapon"""
     if self.secondary:
         weaponindex = spe.getWeaponIndex(self.userid, self.secondary)
         if weaponindex:
             spe.removeEntityByIndex(weaponindex)
         if self.primary:
             es.sexec(self.userid, "use %s" % self.primary)
         else:
             es.sexec(self.userid, "use weapon_knife")
Example #5
0
def OnTick():
    for i in amounts:
        if i not in parachuted and not es.getplayerprop(i, "CBasePlayer.pl.deadflag") and spe.getLocVal("i", spe.getPlayer(i) + buttonPressedOffset) & 32 and es.getplayerprop(i, "CBasePlayer.localdata.m_Local.m_flFallVelocity") >= 1.0 and amounts[i] > 0:
            index = es.createentity("prop_dynamic_override")
            parachuted[i] = index
            es.entitysetvalue(index, "solid", 0)
            es.entitysetvalue(index, "model", random.choice(rpgParachuteModels))
            es.server.insertcmd("es_xspawnentity %i" % index)
            amounts[i] -= 1             
    for i in parachuted.copy():
        if not es.exists("userid", i) or es.getplayerprop(i, "CBasePlayer.pl.deadflag") or es.getplayerprop(i, "CBasePlayer.localdata.m_hGroundEntity") != -1 or es.getplayerprop(i, "CBasePlayer.localdata.m_nWaterLevel") > 1 or not spe.getLocVal("i", spe.getPlayer(i) + buttonPressedOffset) & 32:
            spe.removeEntityByIndex(parachuted[i])
            del parachuted[i]
        else:
            es.entitysetvalue(parachuted[i], "angles", "0 %f 0" % es.getplayerprop(i, "CCSPlayer.m_angEyeAngles[1]"))
            es.entitysetvalue(parachuted[i], "origin", es.getplayerprop(i, "CBaseEntity.m_vecOrigin").replace(",", " "))
            es.setplayerprop(i, "CBasePlayer.localdata.m_vecBaseVelocity", "0,0,%f" % es.getplayerprop(i, "CBasePlayer.localdata.m_Local.m_flFallVelocity"))
Example #6
0
def removeIdleLoop():
    list_noStrip = [(x.strip() if x.strip().startswith('weapon_') else
        'weapon_%s' % x.strip()) for x in
        str(gg_map_strip_exceptions).split(',') if x.strip() != '']

    for weapon in getWeaponList('#all'):
        # Make sure that the admin doesn't want the weapon left on the map
        if weapon in list_noStrip:
            continue

        # Remove all weapons of this type from the map
        for index in weapon.indexlist:
            # If the weapon has an owner, stop here
            if es.getindexprop(index, 'CBaseEntity.m_hOwnerEntity') != -1:
                continue

            spe.removeEntityByIndex(index)

    gamethread.delayedname(5, "gg_removeIdleLoop", removeIdleLoop)
Example #7
0
def removeIdleLoop():
    list_noStrip = [
        (x.strip() if x.strip().startswith('weapon_') else 'weapon_%s' %
         x.strip()) for x in str(gg_map_strip_exceptions).split(',')
        if x.strip() != ''
    ]

    for weapon in getWeaponList('#all'):
        # Make sure that the admin doesn't want the weapon left on the map
        if weapon in list_noStrip:
            continue

        # Remove all weapons of this type from the map
        for index in weapon.indexlist:
            # If the weapon has an owner, stop here
            if es.getindexprop(index, 'CBaseEntity.m_hOwnerEntity') != -1:
                continue

            spe.removeEntityByIndex(index)

    gamethread.delayedname(5, "gg_removeIdleLoop", removeIdleLoop)
Example #8
0
def round_start(event_var):
    '''Called at the start of every round'''

    # Remove weapons from the map
    do_not_strip = [(x.strip() if x.strip().startswith('weapon_') else
        'weapon_%s' % x.strip()) for x in str(
        gg_map_strip_exceptions).split(',') if x.strip() != '']

    for weapon in getWeaponList('#all'):
        # Make sure that the admin doesn't want the weapon left on the map
        if weapon in do_not_strip:
            continue

        # Remove all weapons of this type from the map
        for index in weapon.indexlist:
            # If the weapon has an owner, stop here
            if es.getindexprop(index, 'CBaseEntity.m_hOwnerEntity') != -1:
                continue

            removeEntityByIndex(index)

    # Equip players with a knife and
    # possibly item_kevlar or item_assaultsuit
    equip_player()
Example #9
0
def getgametime():
   index = es.createentity("env_particlesmokegrenade")
   gametime = es.getindexprop(index, "ParticleSmokeGrenade.m_flSpawnTime")
   spe.removeEntityByIndex(index)
   return gametime
Example #10
0
def getgametime():
    index = es.createentity("env_particlesmokegrenade")
    gametime = es.getindexprop(index, "ParticleSmokeGrenade.m_flSpawnTime")
    spe.removeEntityByIndex(index)
    return gametime