Пример #1
0
def do_multi_level(userid):
    # Check userid validity
    if not es.exists('userid', userid):
        return

    # Retrieve the player's name
    name = es.getplayername(userid)

    # Tell everyone we leveled!
    centermsg('#all', "CenterMultiLevelled", {'name': name})
    saytext2('#all', Player(userid).index, 'MultiLevelled', {'name': name})

    # Play game sound
    sound = Player(userid).emitsound('multilevel')

    # Add the player to the multi-leveling dictionary with the sound to
    # remove
    currentMultiLevel[userid] = sound

    # Create env_spark
    spark_instance = spe.giveNamedItem(userid, "env_spark")
    spark_index = spe.getIndexOfEntity(spark_instance)

    cmd = 'es_xfire %s env_spark SetParent !activator;' % userid
    cmd += 'es_xfire %s env_spark AddOutput "spawnflags 896";' % userid
    cmd += 'es_xfire %s env_spark AddOutput "angles -90 0 0";' % userid
    cmd += 'es_xfire %s env_spark AddOutput "magnitude 8";' % userid
    cmd += 'es_xfire %s env_spark AddOutput "traillength 3";' % userid
    cmd += 'es_xfire %s env_spark StartSpark' % userid
    es.server.queuecmd(cmd)

    # Set the player's speed
    getPlayer(userid).speed = int(gg_multi_level_speed) / 100.0

    # If gg_multi_level_gravity is enabled, ajust the player's gravity
    if int(gg_multi_level_gravity) != 100 and int(gg_multi_level_gravity) >= 0:
        gravity.addGravityChange(userid, int(gg_multi_level_gravity) * 0.01)

    # Append the spark's index to this player's list
    if spark_index:
        Player(userid).multiLevelEntities.append(spark_index)

    # Set up the gg_multi_level event
    gg_multi_level_event = GG_Multi_Level(userid=userid, leveler=userid)

    # Fire the gg_multi_level event
    gg_multi_level_event.fire()
Пример #2
0
def do_multi_level(userid):
    # Check userid validity
    if not es.exists('userid', userid):
        return

    # Retrieve the player's name
    name = es.getplayername(userid)

    # Tell everyone we leveled!
    centermsg('#all', "CenterMultiLevelled", {'name': name})
    saytext2('#all', Player(userid).index, 'MultiLevelled', {'name': name})

    # Play game sound
    sound = Player(userid).emitsound('multilevel')

    # Add the player to the multi-leveling dictionary with the sound to
    # remove
    currentMultiLevel[userid] = sound

    # Create env_spark
    spark_instance = spe.giveNamedItem(userid, "env_spark")
    spark_index = spe.getIndexOfEntity(spark_instance)

    cmd = 'es_xfire %s env_spark SetParent !activator;' % userid
    cmd += 'es_xfire %s env_spark AddOutput "spawnflags 896";' % userid
    cmd += 'es_xfire %s env_spark AddOutput "angles -90 0 0";' % userid
    cmd += 'es_xfire %s env_spark AddOutput "magnitude 8";' % userid
    cmd += 'es_xfire %s env_spark AddOutput "traillength 3";' % userid
    cmd += 'es_xfire %s env_spark StartSpark' % userid
    es.server.queuecmd(cmd)

    # Set the player's speed
    getPlayer(userid).speed = int(gg_multi_level_speed) / 100.0

    # If gg_multi_level_gravity is enabled, ajust the player's gravity
    if int(gg_multi_level_gravity) != 100 and int(gg_multi_level_gravity) >= 0:
        gravity.addGravityChange(userid, int(gg_multi_level_gravity) * 0.01)

    # Append the spark's index to this player's list
    if spark_index:
        Player(userid).multiLevelEntities.append(spark_index)

    # Set up the gg_multi_level event
    gg_multi_level_event = GG_Multi_Level(userid=userid, leveler=userid)

    # Fire the gg_multi_level event
    gg_multi_level_event.fire()
Пример #3
0
def loadRandomPoints(userid):
    # Remove existing spawnpoints
    for tSpawn in es.getEntityIndexes('info_player_terrorist'):
        es.server.cmd('es_xremove %s' % tSpawn)
    for ctSpawn in es.getEntityIndexes('info_player_counterterrorist'):
        es.server.cmd('es_xremove %s' % ctSpawn)

    # Loop through the spawnpoints
    for spawn in spawnPoints:
        for team in ('info_player_terrorist', 'info_player_counterterrorist'):
            # Create the spawnpoint and get the index
            index = spe.getIndexOfEntity(spe.giveNamedItem(userid, team))

            # Set the spawnpoint position and rotation
            es.setindexprop(index, 'CBaseEntity.m_vecOrigin',
                '%s,%s,%s' % (spawn[0], spawn[1], spawn[2]))
            es.setindexprop(index, 'CBaseEntity.m_angRotation',
                '0,%s,0' % spawn[4])
Пример #4
0
def loadRandomPoints(userid):
    # Remove existing spawnpoints
    for tSpawn in es.getEntityIndexes('info_player_terrorist'):
        es.server.cmd('es_xremove %s' % tSpawn)
    for ctSpawn in es.getEntityIndexes('info_player_counterterrorist'):
        es.server.cmd('es_xremove %s' % ctSpawn)

    # Loop through the spawnpoints
    for spawn in spawnPoints:
        for team in ('info_player_terrorist', 'info_player_counterterrorist'):
            # Create the spawnpoint and get the index
            index = spe.getIndexOfEntity(spe.giveNamedItem(userid, team))

            # Set the spawnpoint position and rotation
            es.setindexprop(index, 'CBaseEntity.m_vecOrigin',
                            '%s,%s,%s' % (spawn[0], spawn[1], spawn[2]))
            es.setindexprop(index, 'CBaseEntity.m_angRotation',
                            '0,%s,0' % spawn[4])