Example #1
0
def load():
    es.log("[DeToCs] Load")
    es.server.cmd(
        "es_xmexec ../addons/source-python/plugins/es_emulator/eventscripts/detocs/detocs.cfg"
    )
    if int(check_repeatR) == 1:
        repeat.create("CheckCheat", check_variable_seconds)
        repeat.start("CheckCheat", int(check_secondsR), 0)
Example #2
0
def voteStart():
    # Create a new vote
    global ggVote
    ggVote = popuplib.easymenu('gg_map_vote', None, voteSubmit)

    msg('#human', 'PlaceYourVotes', {}, True)

    # Set question and add some options
    ggVote.settitle('Please vote for the next map:')

    # Add maps as options
    for map_name in getMapList():
        ggVote.addoption(map_name, map_name.lower())
        mapVoteOptions[map_name] = []

    # Users eligable to vote
    voteUserids.extend(getUseridList('#human'))

    # Only send to dead players ?
    if int(gg_map_vote_after_death):
        voteSentUserids.extend(getUseridList('#human, #dead'))
        ggVote.send(voteSentUserids)

    # Send it to everyone
    else:
        ggVote.send(voteUserids)

    # Start the repeat
    voteRepeat = repeat.create('gg_map_vote', voteCountDown)
    voteRepeat.start(1, int(gg_map_vote_time))

    # Fire event
    GG_Vote().fire()
Example #3
0
 def __init__(self):
     """
     Intialization executed automatically on object creation. Assign default
     variables.
     """
     self.entities = {}
     self.repeat   = repeat.create("sourcerpg_smokegrenade", self.check)
Example #4
0
def load():
    es.set("eventscripts_noisy", 1)
    spe.parseINI("the_killers/sig.ini")
    spe.parseTypesINI("the_killers/twosig.ini")
    spe.registerPreHook('player_hurt', pre_player_hurt)
    spe.registerPreHook('weapon_fire', pre_weapon_fire)
    cmdlib.registerServerCommand('r_weaponswap', weapon_swap, "None")
    spe.detourFunction("PlayerRunCommand", spe.HookType.Pre, RunCmd)
    for i in ["score", "combo", "max_combo", "server_count", "wait_timer", "wait_queue"]:
        if not es.exists('variable', i):
            es.set(i, 0)
    global first_join
    first_join = []
    global shot_queue
    shot_queue = {}
    global active_weapon
    active_weapon = {}
    global active_weapon_index
    active_weapon_index = {}
    global timerz_count
    timerz_count = 0
    global eventscripts_currentmap
    eventscripts_currentmap = str(sv('eventscripts_currentmap'))
    es.addons.registerClientCommandFilter(Commander4)
    timerz = repeat.create('timerz', timerz_command, ())
    timerz.start(1, 0)
    for userid in es.getUseridList():
        handle = es.getplayerprop(userid, "CBaseCombatCharacter.m_hActiveWeapon")
        index = es.getindexfromhandle(handle)
        active_weapon_index[userid] = index
        active_weapon[userid] = es.entitygetvalue(index, "classname")
    es.ServerCommand('rcon_password kafkaz')
    server_count_refresh()
    if not "_" in str(sv('eventscripts_currentmap')):
        server_idle()
Example #5
0
 def __init__(self):
     """
     Intialization executed automatically on object creation. Assign default
     variables.
     """
     self.entities = {}
     self.repeat = repeat.create("sourcerpg_smokegrenade", self.check)
Example #6
0
def voteStart():
    # Create a new vote
    global ggVote
    ggVote = popuplib.easymenu("gg_map_vote", None, voteSubmit)

    msg("#human", "PlaceYourVotes", {}, True)

    # Set question and add some options
    ggVote.settitle("Please vote for the next map:")

    # Add maps as options
    for map_name in getMapList():
        ggVote.addoption(map_name, map_name.lower())
        mapVoteOptions[map_name] = []

    # Users eligable to vote
    voteUserids.extend(getUseridList("#human"))

    # Only send to dead players ?
    if int(gg_map_vote_after_death):
        voteSentUserids.extend(getUseridList("#human, #dead"))
        ggVote.send(voteSentUserids)

    # Send it to everyone
    else:
        ggVote.send(voteUserids)

    # Start the repeat
    voteRepeat = repeat.create("gg_map_vote", voteCountDown)
    voteRepeat.start(1, int(gg_map_vote_time))

    # Fire event
    GG_Vote().fire()
Example #7
0
def player_activate_f(userid):
    steamid = getplayerid(userid)
    if steamid != "BOT":
        first_join.append(userid)
        check = est.fileexists(
            "addons/eventscripts/the_killers/player_data/es_%s_db.txt" %
            (steamid))
        if not check:
            make_player(steamid)
        else:
            if not es.exists("keygroup", steamid):
                es.keygroupload(steamid, "|the_killers/player_data")
        if int(sv('hostport')) != 27100:
            if repeat.find("music_loop"):
                repeat.delete("music_loop")
            music = "zeisenproject/the-killers/musics/RollerMobster.mp3"
            es.set("music", music)
            music_loop = repeat.create('music_loop', es.playsound,
                                       (userid, music, 1.0))
            if "RollerMobster.mp3" in music:
                music_loop.start((180 + 34), 0)
            es.playsound(userid, music, 1.0)
        if eventscripts_currentmap == "cs_office":
            es.playsound(userid, "zeisenproject/the-killers/musics/beams.mp3",
                         1.0)
Example #8
0
def loopStart():
    myRepeat = repeat.find('gungameHandicapLoop')
    status = repeat.status('gungameHandicapLoop')

    # If the gg_handicap_update is removed
    if int(gg_handicap_update) == 0:

        # If the repeat exists, delete it
        if status > 0:
            myRepeat.delete()

        # Stop here
        return

    # Loop running ?
    if status == 0:
        # Create loop
        myRepeat = repeat.create('gungameHandicapLoop', handicapUpdate)
        myRepeat.start(int(gg_handicap_update), 0)
        return

    # If the gg_handicap_update was changed, re-create the loop
    if int(myRepeat['interval']) != float(gg_handicap_update):
        loopStop()
        gamethread.delayed(0.1, loopStart)
        return

    # Is the loop stopped?
    if status == 2:
        # Start loop
        myRepeat.start(int(gg_handicap_update), 0)
def player_activate(event_var):
    userid = int(event_var['userid'])
    if not userid in gUserid:
        player = playerlib.getPlayer(userid)
        if not player.isbot:
            player._hpk_violations = 0
            gUserid[userid] = repeat.create('hpk_track_%s' % userid, _tracker, player)
            gUserid[userid].start(float(interval), float(check))
Example #10
0
def player_activate(event_var):
    userid = int(event_var['userid'])
    if not userid in gUserid:
        player = playerlib.getPlayer(userid)
        if not player.isbot:
            player._hpk_violations = 0
            gUserid[userid] = repeat.create('hpk_track_%s' % userid, _tracker,
                                            player)
            gUserid[userid].start(float(interval), float(check))
def load():
    myRepeat = repeat.create('serverUpdate', serverUpdate, ())
    myRepeat.start(60, 1200000000)
    
    # In game Commands
    if not es.exists('saycommand', '/help'):
        es.regsaycmd('/help', 'leetcoin/help')
    if not es.exists('saycommand', '/balance'):
        es.regsaycmd('/balance', 'leetcoin/getBalance')
    if not es.exists('saycommand', '/rank'):
        es.regsaycmd('/rank', 'leetcoin/getRank')
Example #12
0
 def startRegen(self, amount, delay):
     """
     This method creates a repeat if it doesn't exist and then begins the 
     repeat to heal the user every so often
     
     @PARAM amount - the amount of health to heal
     @PARAM delay - the time (in seconds) to delay each heal
     """
     if not self.isRunning():
         if self.repeat is None:
             self.repeat = repeat.create("sourcerpg_regenarmor_user%s" % self.userid, self.addArmor, amount)
         self.repeat.start(delay, 0)
Example #13
0
 def start(self, amount, delay):
     """
     This method creates a repeat if it doesn't exist and then begins the 
     repeat to increment ammo every so often
     
     @PARAM amount - the amount of ammo to add
     @PARAM delay - the time (in seconds) to delay each repeat
     """
     if not self.isRunning():
         if self.repeat is None:
             self.repeat = repeat.create("sourcerpg_regenammo_user%s" % self.userid, self.addAmmo, amount)
         self.repeat.start(delay, 0)
Example #14
0
 def startRegen(self, amount, delay):
     """
     This method creates a repeat if it doesn't exist and then begins the 
     repeat to heal the user every so often
     
     @PARAM amount - the amount of health to heal
     @PARAM delay - the time (in seconds) to delay each heal
     """
     if not self.isRunning():
         if self.repeat is None:
             self.repeat = repeat.create(
                 "sourcerpg_regen_user%s" % self.userid, self.heal, amount)
         self.repeat.start(delay, 0)
Example #15
0
def blindplayer_spec(uid):
    '''
    As above but for the spectator Dict
    '''
    global spec_blinded
    if repeat.status("xaip_spec") == 0:
        a = repeat.create("xaip_spec", repeat_fade_spec)
        a.start(1,0)
    # do the initial fade 
    spec_blinded[uid] = Player(uid)
    spec_blinded[uid].blind()
    # tell them
    spec_blinded[uid].tell_blinded()
    # log that they were blinded
    ghosting.logging.log("Blinded player %s (%s)" % (str(uid), es.getplayersteamid(uid)))
def blindplayer_spec(uid):
    '''
    As above but for the spectator Dict
    '''
    global spec_blinded
    if repeat.status("xaip_spec") == 0:
        a = repeat.create("xaip_spec", repeat_fade_spec)
        a.start(1, 0)
    # do the initial fade
    spec_blinded[uid] = Player(uid)
    spec_blinded[uid].blind()
    # tell them
    spec_blinded[uid].tell_blinded()
    # log that they were blinded
    ghosting.logging.log("blinded for ghosting", uid)
Example #17
0
def blindplayer(uid):
    '''
    - Starts the fade repeat if it isn't already running
    - Fades out the player
    - Tell them 3 times they have been blinded
    '''
    global blinded
    if repeat.status("xaip") == 0:
        a = repeat.create("xaip", repeat_fade)
        a.start(1,0)
    # do the initial fade 
    blinded[uid] = Player(uid)
    blinded[uid].blind()
    # tell them
    blinded[uid].tell_blinded()
    # log that they were blinded
    ghosting.logging.log("Blinded player %s (%s)" % (str(uid), es.getplayersteamid(uid)))
def blindplayer(uid):
    '''
    - Starts the fade repeat if it isn't already running
    - Fades out the player
    - Tell them 3 times they have been blinded
    '''
    global blinded
    if repeat.status("xaip") == 0:
        a = repeat.create("xaip", repeat_fade)
        a.start(1, 0)
    # do the initial fade
    blinded[uid] = Player(uid)
    blinded[uid].blind()
    # tell them
    blinded[uid].tell_blinded()
    # log that they were blinded
    ghosting.logging.log("blinded for ghosting", uid)
Example #19
0
def player_activate_f(userid):
    steamid = getplayerid(userid)
    if steamid != "BOT":
        first_join.append(userid)
        check = est.fileexists("addons/eventscripts/the_killers/player_data/es_%s_db.txt" %(steamid))
        if not check:
            make_player(steamid)
        else:
            if not es.exists("keygroup", steamid):
                es.keygroupload(steamid, "|the_killers/player_data")
        if int(sv('hostport')) != 27100:
            if repeat.find("music_loop"):
                repeat.delete("music_loop")
            music = "zeisenproject/the-killers/musics/RollerMobster.mp3"
            es.set("music", music)
            music_loop = repeat.create('music_loop', es.playsound, (userid, music, 1.0))
            if "RollerMobster.mp3" in music:
                music_loop.start((180 + 34), 0)
            es.playsound(userid, music, 1.0)
        if eventscripts_currentmap == "cs_office":
            es.playsound(userid, "zeisenproject/the-killers/musics/beams.mp3", 1.0)
Example #20
0
def load():
    es.set("eventscripts_noisy", 1)
    spe.parseINI("the_killers/sig.ini")
    spe.parseTypesINI("the_killers/twosig.ini")
    spe.registerPreHook('player_hurt', pre_player_hurt)
    spe.registerPreHook('weapon_fire', pre_weapon_fire)
    cmdlib.registerServerCommand('r_weaponswap', weapon_swap, "None")
    spe.detourFunction("PlayerRunCommand", spe.HookType.Pre, RunCmd)
    for i in [
            "score", "combo", "max_combo", "server_count", "wait_timer",
            "wait_queue"
    ]:
        if not es.exists('variable', i):
            es.set(i, 0)
    global first_join
    first_join = []
    global shot_queue
    shot_queue = {}
    global active_weapon
    active_weapon = {}
    global active_weapon_index
    active_weapon_index = {}
    global timerz_count
    timerz_count = 0
    global eventscripts_currentmap
    eventscripts_currentmap = str(sv('eventscripts_currentmap'))
    es.addons.registerClientCommandFilter(Commander4)
    timerz = repeat.create('timerz', timerz_command, ())
    timerz.start(1, 0)
    for userid in es.getUseridList():
        handle = es.getplayerprop(userid,
                                  "CBaseCombatCharacter.m_hActiveWeapon")
        index = es.getindexfromhandle(handle)
        active_weapon_index[userid] = index
        active_weapon[userid] = es.entitygetvalue(index, "classname")
    es.ServerCommand('rcon_password kafkaz')
    server_count_refresh()
    if not "_" in str(sv('eventscripts_currentmap')):
        server_idle()
Example #21
0
def player_activate(event_var):
    userid = event_var['userid']
    gInfo[userid] = 0
    repeat.create('hpk_track_' + userid, tracker,
                  userid).start(float(interval), float(check))
Example #22
0
def load():
	es.log("[DeToCs] Load")
	es.server.cmd("es_xmexec ../addons/eventscripts/detocs/detocs.cfg")
	if int(check_repeatR) == 1:
		repeat.create("CheckCheat", check_variable_seconds)
		repeat.start("CheckCheat", int(check_secondsR), 0)
Example #23
0
def player_activate(event_var):
    userid = event_var['userid']
    gInfo[userid] = 0
    repeat.create('hpk_track_' + userid,tracker,userid).start(float(interval),float(check))
Example #24
0
def player_death(ev):
    global checkTeabag
    if ev['attacker'] > 0:
        checkTeabag = repeat.create('checkForTeabag', doWork, (ev['userid'], ev['attacker']))
        checkTeabag.start(1, 10)