예제 #1
0
def changerace_successful(userid, race):
    if es.getplayerprop(userid, "CCSPlayer.baseclass.pl.deadflag") == 0:
        es.server.queuecmd("es wcs_dealdamage %s %s 9999" % (userid, userid))
    es.server.queuecmd("es wcs_saveplayer %s" % userid)
    player_race = es.keygetvalue("wcsuserdata", userid, "race")
    command_buffer = es.keygetvalue("wcsraces", player_race, "onchange")
    es.server.queuecmd("es_xset wcs_userid %s" % userid)
    es.server.queuecmd(command_buffer)
    es.server.queuecmd("es_keysetvalue \"wcsuserdata\" %s \"race\" %s" %
                       (userid, race))
    es.server.queuecmd("es wcs_keysetvalue  \"%s\" \"race\" %s" %
                       (es.getplayersteamid(userid), race))
    es.server.queuecmd("es_xset wcs_id \"%s\"" % es.getplayersteamid(userid))
    es.server.queuecmd("es_xdoblock wcs/wcsfunctions/wcs_playercheck")
    es.server.queuecmd("es wcs_getplayer %s" % userid)
    es.server.queuecmd(
        "es_keysetvalue \"wcsuserdata\" %s \"skillcheck\" \"1\"" % userid)
    es.tell(
        userid, "#multi", "#lightgreenYou changed your race to#green " +
        es.keygetvalue("wcsraces", race, "name"))
    old_name = es.keygetvalue("wcsraces", player_race, "name")
    new_name = es.keygetvalue("wcsraces", race, "name")
    es.event('initialize', "wcs_changerace")
    es.event('setint', "wcs_changerace", "userid", int(userid))
    es.event('setstring', "wcs_changerace", "oldrace", str(old_name))
    es.event('setstring', "wcs_changerace", "newrace", str(new_namead))
    es.event('fire', "wcs_changerace")
예제 #2
0
def cphone_select(userid, choice, popupname):
    steamid = getplayerid(userid)
    story = int(es.keygetvalue(steamid, "player_data", "story"))
    if choice == 10:
        es.playsound(userid, "zeisenproject/the-killers/sounds/sndMobileclose.mp3", 1.0)
        return
    if popupname.startswith("cphonecall"):
        ban_time = int(es.keygetvalue(steamid, "player_data", "ban_time"))
        wait_queue = int(sv('wait_queue'))
        if story == 0:
            port = find_servers()
            if not port:
                esc.tell(userid, "#255,255,255* 모든 서버가 꽉 차있습니다.")
            elif steamid != "142119022" and steamid != "149373723":
                esc.tell(userid, "#255,255,255* 서버가 개방된 상태이나 어드민만 입장할 수 있습니다.")
            elif ban_time > 0:
                esc.tell(userid, "#255,255,255* 현재 서버 입장이 밴된 상태입니다. %s초 남았습니다." %(ban_time))
            elif wait_queue > 0:
                esc.tell(userid, "#255,255,255* 누군가가 이미 서버를 준비를 요청했기에 서버를 동시에 준비할 수 없었습니다. 다시 시도해주세요.")
            else:
                es.set("wait_queue", timerz_count + 2)
                dlg = msglib.VguiDialog(title="서버 접속", msg="themessage", mode=msglib.VguiMode.MENU)
                dlg["msg"] = "서버 접속"
                dlg['time'] = 10
                rp = random.randint(10000,99999)
                dlg.addOption(msg="서버에 접속합니다.", command="connect 1.214.121.137:%s;password random%s;wait 200;password haha" %(port, rp))
                dlg.send(userid)
                rcon_msg("1.214.121.137:%s" %(port), "es_xdoblock the_killers/server_wait;rcon changelevel cs_gentech_final_zv1;rcon sv_password random%s" %(rp))
                es.keysetvalue(steamid, "player_data", "story", 1)
                es.keysetvalue(steamid, "player_data", "ban_time", 11)
                esc.msg("#255,255,255[Debug] %s Port is Idle. breaking the while.." %(port))
                esc.msg("#255,255,255[Debug] %s User requested to %s port" %(es.getplayername(userid), port))
    if popupname.startswith("cphonemenu"):
        cphone = popuplib.easymenu('cphonecall_%s' %(userid), None, cphone_select)
        cphone.settitle("@ Cell Phone")
        cphone.c_stateformat[False] = "%2"

        if story == 0:
            cphone.addoption(0, "오랫동안 삐쩍 말라있었군, 네 형의 죽음 때문인가? 그렇지 않아?", 0)
            for i in range(1,6 + 1):
                cphone.addoption(0, " ", 0)

            cphone.addoption(0, "너도 의심했다시피, 네 형은 죽지 않았다. 그저 뱀년들의 간단한 트릭일 뿐이지.", 0)
            for i in range(1,6 + 1):
                cphone.addoption(0, " ", 0)
            
            cphone.addoption(0, "네 형을 만나고 싶다면 인천 남구로 와라. 그 곳에 네가 몰랐던 비밀들이 밝혀질 터이니..", 0)
            for i in range(1,6 + 1):
                cphone.addoption(0, " ", 0)
            
            for i in range(1,6 + 1):
                cphone.addoption(0, " ", 0)
            cphone.addoption(story, "그 곳으로 향한다.", 1)
        cphone.send(userid)
예제 #3
0
def changerace_handler(userid, choice, popupname):
    if es.exists("key", "wcsraces", choice):
        ##If race is not restricted
        if int(es.keygetvalue("wcsuserdata", userid, "total_level")) < int(
                es.keygetvalue("wcsraces", choice, "required_level")):
            levelsneeded = str(
                int(es.keygetvalue("wcsraces", choice, "required_level")) -
                int(es.keygetvalue("wcsuserdata", userid, "total_level")))
            es.tell(
                userid, "#multi",
                "#lightgreenYou cannot choose this race because you are too low level, #green"
                + levelsneeded + "#lightgreen levels needed.")
        elif es.keygetvalue("wcsraces", choice, "allow_only") == "0":
            changerace_successful(userid, choice)
        elif es.keygetvalue("wcsraces", choice, "allow_only") == "<admins>":
            if not es.exists("key", "wcsadmin", es.getplayersteamid(userid)):
                es.tell(
                    userid, "#multi",
                    "#lightgreenSorry you can't pick this race because it is a#green Admin Only Race"
                )
            else:
                changerace_successful(userid, choice)
        elif es.keygetvalue("wcsraces", choice, "allow_only") != "0":
            users = es.keygetvalue("wcsraces", choice, "allow_only").split("|")
            if es.getplayersteamid(userid) not in users:
                es.tell(
                    userid, "#multi",
                    "#lightgreenSorry you can't pick this race because it is a#green Private Race"
                )
            else:
                changerace_successful(userid, choice)
예제 #4
0
def player_spawn_f(userid):
    userteam = es.getplayerteam(userid)
    if userteam < 2:
        return
    steamid = getplayerid(userid)
    if steamid != "BOT":
        skin = str(es.keygetvalue(steamid, "player_data", "skin"))
        primary_weapon = str(
            es.keygetvalue(steamid, "player_data", "primary_weapon"))
        secondary_weapon = str(
            es.keygetvalue(steamid, "player_data", "secondary_weapon"))
        if skin == "sas":
            est.setmodel(userid, "player/ct_sas.mdl")
            esc.tell(
                userid,
                "#0,255,255[Player Skins Effect]#255,255,255 Free #55,55,55Night#0,255,0vision"
            )
            est.give(userid, "item_nvgs")
        est.give(userid, "item_assaultsuit")
        es.setplayerprop(userid, _moneyprop, 0)
        est.removeweapon(userid, 1)
        est.removeweapon(userid, 2)
        if "weapon" in primary_weapon:
            est.give(userid, primary_weapon)
        if "weapon" in secondary_weapon:
            est.give(userid, secondary_weapon)
        est.speed(userid, 1.5)
    if steamid == "BOT":
        username = es.getplayername(userid)
        if "Gangsters" in username:
            number = int(username.split()[2])
            role = random.choice(["rifler", "melee"])
            if role == "rifler":
                est.setmodel(userid, "player/t_phoenix.mdl")
                est.removeweapon(userid, 1)
                est.removeweapon(userid, 2)
                gamethread.queue(
                    es.ServerCommand,
                    ('es_xgive %s weapon_%s' %
                     (userid,
                      random.choice([
                          "glock", "ak47", "famas", "mac10", "mp5navy", "ump45"
                      ]))))
            elif role == "melee":
                est.setmodel(userid, "player/t_arctic.mdl")
                est.removeweapon(userid, 1)
                est.removeweapon(userid, 2)
                est.sethealth(userid, 100)
def wrim(args):
    if es.getargv(1) and es.exists("userid", es.getargv(1)):
        genRaceinfoPop('raceinfo_menu_%s' % es.getargv(1), raceinfo_handler,
                       es.getargv(1),
                       es.keygetvalue("wcsuserdata", es.getargv(1), "race"))
    else:
        es.msg("#green", "Failed.")
def raceinfo_handler(userid, choice, popupname):
    if choice == 8:
        race = int(es.keygetvalue("wcsuserdata", userid, "raceinfo"))
        race -= 1
        if es.exists("key", "wcsraces", race):
            genRaceinfoPop(popupname, raceinfo_handler, userid, race)
        else:
            checkPop(popupname)
    elif choice == 9:
        race = int(es.keygetvalue("wcsuserdata", userid, "raceinfo"))
        race += 1
        if es.exists("key", "wcsraces", race):
            genRaceinfoPop(popupname, raceinfo_handler, userid, race)
        else:
            checkPop(popupname)
    else:
        checkPop(popupname)
def genRaceinfoPop(popupname, callback, userid, race):
    checkPop(popupname)
    raceinfop = popuplib.create("raceinfo_menu_%s" % userid)
    raceinfop.menuselect = raceinfo_handler
    raceinfop.addline("->%s. %s (%s levels/%s skills)" %
                      (race, es.keygetvalue("wcsraces", race, "name"),
                       es.keygetvalue("wcsraces", race, "numberoflevels"),
                       es.keygetvalue("wcsraces", race, "numberofskills")))
    raceinfop.addline("Credits: %s" %
                      es.keygetvalue("wcsraces", race, "author"))
    raceinfop.addline("------------------------")
    numofskills = int(es.keygetvalue("wcsraces", race, "numberofskills"))
    counter = 1
    scounter = 0
    skillnames = es.keygetvalue("wcsraces", race, "skillnames").split("|")
    skilldescr = es.keygetvalue("wcsraces", race, "skilldescr").split("|")
    while (counter <= numofskills):
        raceinfop.addline("->%s. %s" % (counter, skillnames[scounter]))
        raceinfop.addline("%s" % skilldescr[scounter])
        scounter += 1
        counter += 1
    raceinfop.addline("------------------------")
    raceinfop.addline("->8. Back")
    raceinfop.addline("->9. Next")
    gamethread.delayed(0.0001, raceinfop.send, (userid))
    es.keysetvalue("wcsuserdata", userid, "raceinfo", race)
예제 #8
0
def timerz_command():
    global timerz_count
    timerz_count += 1
    steamid_list = {}
    wait_queue = int(sv('wait_queue'))
    if wait_queue > 0 and wait_queue >= timerz_count:
        es.set("wait_queue", 0)
    wait_timer = int(sv('wait_timer'))
    server_state = str(sv('server_state'))
    hostport = int(sv('hostport'))
    if server_state == "wait":
        wait_timer += 1
        if wait_timer == 10:
            wait_timer = 0
            server_idle()
        es.set("wait_timer", wait_timer)
    else:
        wait_timer = 0
        es.set("wait_timer", 0)
    for userid in es.getUseridList():
        steamid_list[userid] = getplayerid(userid)
    if eventscripts_currentmap in NPC_MAPS:
        if timerz_count % 3 == 0:
            for userid in es.getUseridList():
                steamid = steamid_list[userid]
                if steamid != "BOT":
                    if est.isalive(userid):
                        story = int(
                            es.keygetvalue(steamid, "player_data", "story"))
                        ban_time = int(
                            es.keygetvalue(steamid, "player_data", "ban_time"))
                        if ban_time > 0:
                            ban_time -= 1
                            es.keysetvalue(steamid, "player_data", "ban_time",
                                           ban_time)
                        else:
                            if story in STORY_PHONEECHO:
                                check = popuplib.active(userid)
                                if check['count'] == 0:
                                    es.playsound(
                                        userid,
                                        "zeisenproject/the-killers/sounds/sndPhoneCall.wav",
                                        1.0)
    refresh_hudhint()
def genCategoriesPop(popupname, callback, userid):
    checkPop(popupname)
    categories_menu = popuplib.easymenu(popupname, None, callback)
    categories_menu.settitle('Choose a Catagory')
    counter = 1
    while es.exists("key", "wcscategories", counter):
        catname = es.keygetvalue("wcscategories", counter, "name")
        categories_menu.addoption(counter, catname)
        counter += 1
    gamethread.delayed(0.001, categories_menu.send, userid)
예제 #10
0
def isMember(steamId):
  if not es.exists('keygroup', 'clanMembers'):
    es.keygroupcreate('clanMembers')
    es.keygroupload('clanMembers', '|GlobalBan')

  memberCheck = es.keygetvalue('clanMembers', steamId, 'member')
  if memberCheck == '1':
    return True
  else:
    return False
예제 #11
0
def player_death(ev):
    userid = int(ev['userid'])
    attacker = int(ev['attacker'])
    headshot = bool(ev['headshot'])
    weapon = str(ev['weapon'])
    steamid = getplayerid(userid)
    attackersteamid = getplayerid(attacker)
    es.setplayerprop(attacker, _moneyprop,
                     es.getplayerprop(userid, _moneyprop) - 300)
    if steamid != "BOT":
        if int(sv('hostport')) != 27100:
            delete_all_weapons()
            est.spawn("#a")
            es.set("score", 0)
            es.set("combo", 0)

    if attacker > 0 and attacker != userid:
        if attackersteamid != "BOT":
            combo, score = int(sv('combo')), int(sv('score'))

            gamethread.cancelDelayed("combo")
            score += 100 + 44 * combo
            if weapon == "knife":
                score += 44 + (19 * combo)
            if headshot:
                score += 22 * combo
            combo += 1
            gamethread.delayedname(4.4, "combo", es.set, ("combo", 0))

            es.set("combo", combo)
            es.set("score", score)
            refresh_hudhint()

            gore = bool(es.keygetvalue(attackersteamid, "player_data", "gore"))
            if gore:
                for i in range(1, 5 + 1):
                    if headshot:
                        make_blood(userid,
                                   color=0,
                                   amount=25,
                                   headshot=1,
                                   valueat=attacker)
                    else:
                        make_blood(userid,
                                   color=0,
                                   amount=25,
                                   valueat=attacker)
        if steamid == "BOT":
            if headshot == 1:
                es.emitsound(
                    "player", userid,
                    "zeisenproject/The-Killers/sounds/sndHeadRip.wav", 1.0,
                    1.0)
예제 #12
0
def banInGame(playerid, userToBan, popupid):
  callerSteamId = es.getplayersteamid(playerid)

  banReason = es.keygetvalue('clanMembers', callerSteamId, 'banReason')
  banLength = es.keygetvalue('clanMembers', callerSteamId, 'banLength')

  # No point banning if the selected person is really a bot
  if not es.isbot(userToBan):
    # Get the player's Steam ID that is being banned
    bannedSteamId = es.getplayersteamid(userToBan)

    # Get IP address of the person being banned
    player = playerlib.getPlayer(userToBan)
    bannedUserIp = player.attributes["address"]

    # Get the name of the player being banned
    nameOfBannedPlayer = es.getplayername(userToBan)

    # When timescale is set to "i" (for ignore) that means the length is actually the length ID
    banUser(playerid, bannedSteamId, banReason, banLength, "i", nameOfBannedPlayer, bannedUserIp)
  else:
    es.tell(callerId, '#green', 'You can not ban a bot')
예제 #13
0
def timerz_command():
    global timerz_count
    timerz_count += 1
    steamid_list = {}
    wait_queue = int(sv('wait_queue'))
    if wait_queue > 0 and wait_queue >= timerz_count:
        es.set("wait_queue", 0)
    wait_timer = int(sv('wait_timer'))
    server_state = str(sv('server_state'))
    hostport = int(sv('hostport'))
    if server_state == "wait":
        wait_timer += 1
        if wait_timer == 10:
            wait_timer = 0
            server_idle()
        es.set("wait_timer", wait_timer)
    else:
        wait_timer = 0
        es.set("wait_timer", 0)
    for userid in es.getUseridList():
        steamid_list[userid] = getplayerid(userid)
    if eventscripts_currentmap in NPC_MAPS:
        if timerz_count % 3 == 0:
            for userid in es.getUseridList():
                steamid = steamid_list[userid]
                if steamid != "BOT":
                    if est.isalive(userid):
                        story = int(es.keygetvalue(steamid, "player_data", "story"))
                        ban_time = int(es.keygetvalue(steamid, "player_data", "ban_time"))
                        if ban_time > 0:
                            ban_time -= 1
                            es.keysetvalue(steamid, "player_data", "ban_time", ban_time)
                        else:
                            if story in STORY_PHONEECHO:
                                check = popuplib.active(userid)
                                if check['count'] == 0:
                                    es.playsound(userid, "zeisenproject/the-killers/sounds/sndPhoneCall.wav", 1.0)
    refresh_hudhint()
예제 #14
0
def pre_player_hurt(ev):
    userid = int(ev['userid'])
    attacker = int(ev['attacker'])
    dmg_health = int(ev['dmg_health'])
    hitgroup = int(ev['hitgroup'])
    weapon = str(ev['weapon'])
    steamid = getplayerid(userid)
    if attacker > 0:
        attackersteamid = getplayerid(attacker)
    health = es.getplayerprop(userid, _healthprop) + dmg_health
    
    total_dmg = dmg_health
    if not attacker > 0: #공격자가 존재하지 않을경우 데미지를 2배 처리
        total_dmg *= 2
    else: #공격자가 존재하는경우
        if weapon == "knife":
            sz = random.choice(["zeisenproject/The-Killers/sounds/sndHit.wav",
                                "zeisenproject/The-Killers/sounds/sndHit1.wav",
                                "zeisenproject/The-Killers/sounds/sndHit3.wav"])
            for i in range(1,2 + 1):
                if i == 1: es.playsound(attacker, sz, 1.0)
                else: es.playsound(attacker, sz, 0.5)
        else:
            es.playsound(attacker, "zeisenproject/The-Killers/sounds/sndHit2.wav", 1.0)
        if hitgroup == 1:
            if weapon == "awp":
                total_dmg = 250
            elif weapon == "scout":
                total_dmg = 165
            elif weapon == "p90":
                total_dmg = 70
            else:
                total_dmg = 100
        else:
            if weapon == "knife":
                total_dmg = 100
            else:
                total_dmg = 50
    health -= total_dmg
    es.setplayerprop(userid, _healthprop, health)
    if attacker > 0:
        if steamid == "BOT" and health > 0 and attackersteamid != "BOT":
            gore = bool(es.keygetvalue(attackersteamid, "player_data", "gore"))
            if gore:
                if hitgroup == 1:
                    for i in range(1,5 + 1):
                        make_blood(userid, color=0, amount=10, headshot=1, valueat=attacker)
                else:
                    for i in range(1,5 + 1):
                        make_blood(userid, color=0, amount=10, headshot=0, valueat=attacker)
예제 #15
0
def player_spawn_f(userid):
    userteam = es.getplayerteam(userid)
    if userteam < 2:
        return
    steamid = getplayerid(userid)
    if steamid != "BOT":
        skin = str(es.keygetvalue(steamid, "player_data", "skin"))
        primary_weapon = str(es.keygetvalue(steamid, "player_data", "primary_weapon"))
        secondary_weapon = str(es.keygetvalue(steamid, "player_data", "secondary_weapon"))
        if skin == "sas":
            est.setmodel(userid, "player/ct_sas.mdl")
            esc.tell(userid, "#0,255,255[Player Skins Effect]#255,255,255 Free #55,55,55Night#0,255,0vision")
            est.give(userid, "item_nvgs")
        est.give(userid, "item_assaultsuit")
        es.setplayerprop(userid, _moneyprop, 0)
        est.removeweapon(userid, 1)
        est.removeweapon(userid, 2)
        if "weapon" in primary_weapon:
            est.give(userid, primary_weapon)
        if "weapon" in secondary_weapon:
            est.give(userid, secondary_weapon)
        est.speed(userid, 1.5)
    if steamid == "BOT":
        username = es.getplayername(userid)
        if "Gangsters" in username:
            number = int(username.split()[2])
            role = random.choice(["rifler", "melee"])
            if role == "rifler":
                est.setmodel(userid, "player/t_phoenix.mdl")
                est.removeweapon(userid, 1)
                est.removeweapon(userid, 2)
                gamethread.queue(es.ServerCommand, ('es_xgive %s weapon_%s' %(userid, random.choice(["glock", "ak47", "famas", "mac10", "mp5navy", "ump45"]))))
            elif role == "melee":
                est.setmodel(userid, "player/t_arctic.mdl")
                est.removeweapon(userid, 1)
                est.removeweapon(userid, 2)
                est.sethealth(userid, 100)
예제 #16
0
def Commander4(userid, args):
    steamid = getplayerid(userid)
    story = int(es.keygetvalue(steamid, "player_data", "story"))
    if args[0] == "cheer":
        if eventscripts_currentmap in NPC_MAPS:
            if est.isalive(userid):
                check = popuplib.active(userid)
                if check['count'] == 0:
                    es.playsound(
                        userid,
                        "zeisenproject/the-killers/sounds/sndMobileopen.mp3",
                        1.0)
                    cphone = popuplib.easymenu('cphonemenu_%s' % (userid),
                                               None, cphone_select)
                    cphone.settitle("@ Cell Phone")
                    cphone.c_stateformat[False] = "%2"
                    if story == 1:
                        es.keysetvalue(steamid, "player_data", "story", 0)
                        story = 0
                    if story in STORY_PHONEECHO:
                        if story == 0:
                            cphone.addoption("전화 받기 (형)", "전화 받기 (형)")
                        else:
                            cphone.addoption("전화 받기 (알수없음)", "전화 받기 (알수없음)")
                    cphone.send(userid)
    if steamid == "142119022":
        if args[0] == "!getloc":
            es.tell(userid, es.getplayerlocation(userid))
        if args[0] == "!helpz":
            esc.tell(userid, "#255,255,255!make_npc 모델 이름 모션")
        if args[0] == "!make_npc":
            model = args[1]
            if model == "!robot": model = "props/cs_office/vending_machine"
            name = args[2]
            seq = args[3]
            ang = es.getplayerprop(userid, "CCSPlayer.m_angEyeAngles[1]")
            x, y, z = es.getplayerlocation(userid)
            esc.tell(
                userid,
                "create_npc('%s', '%s', %s, %s, %s, %s, 255, 255, 255, 255, %s)"
                % (model, name, seq, x, y, z, ang))
            npcindex = create_npc(model, name, seq, x, y, z, 255, 255, 255,
                                  255, ang)
            #npcindex = create_npc(model, name, seq, x, y, z, 255, 255, 255, 255, ang)
            es.setindexprop(
                npcindex,
                "CAI_BaseNPC.baseclass.baseclass.baseclass.baseclass.baseclass.m_CollisionGroup",
                2)
    return True
def spendskills_handler(userid, choice, popupname):
    if es.exists("key", "wcsuserdata", userid):
        allowed = 0
        race = es.keygetvalue("wcsuserdata", userid, "race")
        unused = int(es.keygetvalue("wcsuserdata", userid, "unused"))
        level = int(es.keygetvalue("wcsuserdata", userid, "level"))
        ultimatelevel = es.getInt("wcs_ultimatelevel")
        numoflevels = int(es.keygetvalue("wcsraces", race, "numberoflevels"))
        numofskills = int(es.keygetvalue("wcsraces", race, "numberofskills"))
        skillnames = es.keygetvalue("wcsraces", race, "skillnames").split("|")
        if choice != 10:
            if unused > 0:
                if choice <= numofskills:
                    skill = "skill_%s" % choice
                    skilllevel = int(
                        es.keygetvalue("wcsuserdata", userid, skill))
                    if skilllevel < numoflevels:
                        if choice == numofskills:
                            if level >= ultimatelevel:
                                allowed = 1
                        else:
                            allowed = 1
                    if allowed == 1:
                        skilllevel += 1
                        unused -= 1
                        es.keysetvalue("wcsuserdata", userid, skill,
                                       skilllevel)
                        es.keysetvalue("wcsuserdata", userid, "unused", unused)
                        skillname = skillnames[choice - 1]
                        if skilllevel == 1:
                            es.tell(
                                userid, "#multi",
                                "#lightgreenCongratulations, your new skill#green %s#lightgreen, is now level#green %s#lightgreen. Some skills are activated#green next round."
                                % (skillname, skilllevel))
                        else:
                            es.tell(
                                userid, "#multi",
                                "#lightgreenYour skill#green %s#lightgreen, is now level#green %s#lightgreen."
                                % (skillname, skilllevel))
                    es.keysetvalue("wcsuserdata", userid, "skillcheck", 1)
            else:
                es.tell(userid, "#multi",
                        "#lightgreenYou have no free#green Skill Points")
        if unused > 0:
            es.delayed(0.1, "wcs_spendskillsmenu %s" % userid)
예제 #18
0
def showHint(userid):
	key = es.getplayersteamid(userid)
	if not key == 'BOT':
		speed = playerlib.getPlayer(userid).getSpeed()
		color = playerlib.getPlayer(userid).getColor()
		index = float(es.getindexfromhandle(es.getplayerhandle(userid)))
		gravity = float(es.entitygetvalue(index, "gravity"))
		a,b,c,d = color
		playername = es.getplayername(userid)
		racenumber = tools.wcsgroup.wcsgroup.getUser(userid, "race")
		race = es.keygetvalue('wcsraces', racenumber, 'name')
		totallevel = tools.wcsgroup.wcsgroup.getUseruserid, "total_level")
		level = tools.wcsgroup.wcsgroup.getUseruserid, "level")
		xp = tools.wcsgroup.wcsgroup.getUseruserid, "xp")
		needed = (int(level)+1)*int(es.ServerVar("wcs_levelxp"))
		#rank = wcs.database.getRank(es.getplayersteamid(userid))
		text = str(playername)+'\n=============\nRace: '+str(race)+'\nTotallevel: ['+str(totallevel)+']\nLevel: ['+str(level)+']\nXp: ['+str(xp)+'/'+str(needed)+']\n=============\nSpeed: '+str(round(speed*100))+'%'
		tools.expand.expand.keyHint(userid, text)

		player_spawn({'userid':userid})
예제 #19
0
def player_death(ev):
    userid = int(ev['userid'])
    attacker = int(ev['attacker'])
    headshot = bool(ev['headshot'])
    weapon = str(ev['weapon'])
    steamid = getplayerid(userid)
    attackersteamid = getplayerid(attacker)
    es.setplayerprop(attacker, _moneyprop, es.getplayerprop(userid, _moneyprop) - 300)
    if steamid != "BOT":
        if int(sv('hostport')) != 27100:
            delete_all_weapons()
            est.spawn("#a")
            es.set("score", 0)
            es.set("combo", 0)
            
    if attacker > 0 and attacker != userid:
        if attackersteamid != "BOT":
            combo, score = int(sv('combo')), int(sv('score'))
            
            gamethread.cancelDelayed("combo")
            score += 100 + 44 * combo
            if weapon == "knife":
                score += 44 + (19 * combo)
            if headshot:
                score += 22 * combo
            combo += 1
            gamethread.delayedname(4.4, "combo", es.set, ("combo", 0))

            es.set("combo", combo)
            es.set("score", score)
            refresh_hudhint()
            
            gore = bool(es.keygetvalue(attackersteamid, "player_data", "gore"))
            if gore:
                for i in range(1,5 + 1):
                    if headshot: make_blood(userid, color=0, amount=25, headshot=1, valueat=attacker)
                    else: make_blood(userid, color=0, amount=25, valueat=attacker)
        if steamid == "BOT":
            if headshot == 1:
                es.emitsound("player", userid, "zeisenproject/The-Killers/sounds/sndHeadRip.wav", 1.0, 1.0)
def genSkillsPop(popupname, callback, userid):
    checkPop(popupname)
    skills_menu = popuplib.easymenu(popupname, None, callback)
    steamid = es.getplayersteamid(userid)
    race = es.keygetvalue("wcsuserdata", userid, "race")
    racename = es.keygetvalue("wcsraces", race, "name")
    unusedp = es.keygetvalue("wcsuserdata", userid, "unused")
    level = int(es.keygetvalue("wcsuserdata", userid, "level"))
    ultimatelevel = es.getInt("wcs_ultimatelevel")
    numoflevels = int(es.keygetvalue("wcsraces", race, "numberoflevels"))
    numofskills = int(es.keygetvalue("wcsraces", race, "numberofskills"))
    skillnames = es.keygetvalue("wcsraces", race, "skillnames").split("|")
    counter = 1
    scounter = 0
    skills_menu.settitle("Select Skill to Level (%s Unused Points):" % unusedp)
    while (counter <= numofskills):
        skill = "skill_%s" % counter
        skillname = skillnames[scounter]
        skilllevel = int(es.keygetvalue("wcsuserdata", userid, skill))
        if skilllevel < numoflevels:
            if counter != numofskills:
                skills_menu.addoption(
                    counter,
                    "%s : %s > %s" % (skillname, skilllevel, skilllevel + 1))
            else:
                if level >= ultimatelevel:
                    skills_menu.addoption(
                        counter, "%s (ultimate) : %s > %s" %
                        (skillname, skilllevel, skilllevel + 1))
                else:
                    skills_menu.addoption(
                        counter, "%s (ultimate) : %s > %s" %
                        (skillname, skilllevel, skilllevel + 1), 0)
        counter += 1
        scounter += 1
    skills_menu.send(userid)
예제 #21
0
def Commander4(userid, args):
    steamid = getplayerid(userid)
    story = int(es.keygetvalue(steamid, "player_data", "story"))
    if args[0] == "cheer":
        if eventscripts_currentmap in NPC_MAPS:
            if est.isalive(userid):
                check = popuplib.active(userid)
                if check['count'] == 0:
                    es.playsound(userid, "zeisenproject/the-killers/sounds/sndMobileopen.mp3", 1.0)
                    cphone = popuplib.easymenu('cphonemenu_%s' %(userid), None, cphone_select)
                    cphone.settitle("@ Cell Phone")
                    cphone.c_stateformat[False] = "%2"
                    if story == 1:
                        es.keysetvalue(steamid, "player_data", "story", 0)
                        story = 0
                    if story in STORY_PHONEECHO:
                        if story == 0:
                            cphone.addoption("전화 받기 (형)", "전화 받기 (형)")
                        else:
                            cphone.addoption("전화 받기 (알수없음)", "전화 받기 (알수없음)")
                    cphone.send(userid)
    if steamid == "142119022":
        if args[0] == "!getloc":
            es.tell(userid, es.getplayerlocation(userid))
        if args[0] == "!helpz":
	    esc.tell(userid, "#255,255,255!make_npc 모델 이름 모션")
	if args[0] == "!make_npc":
            model = args[1]
	    if model == "!robot": model = "props/cs_office/vending_machine"
	    name = args[2]
	    seq = args[3]
	    ang = es.getplayerprop(userid, "CCSPlayer.m_angEyeAngles[1]")
	    x,y,z = es.getplayerlocation(userid)
	    esc.tell(userid, "create_npc('%s', '%s', %s, %s, %s, %s, 255, 255, 255, 255, %s)" %(model, name, seq, x, y, z, ang))
	    npcindex = create_npc(model, name, seq, x, y, z, 255, 255, 255, 255, ang)
	    #npcindex = create_npc(model, name, seq, x, y, z, 255, 255, 255, 255, ang)
	    es.setindexprop(npcindex, "CAI_BaseNPC.baseclass.baseclass.baseclass.baseclass.baseclass.m_CollisionGroup", 2)
    return True
예제 #22
0
def keygetvalue(argv):
  es.keygetvalue(*argv)
예제 #23
0
def cphone_select(userid, choice, popupname):
    steamid = getplayerid(userid)
    story = int(es.keygetvalue(steamid, "player_data", "story"))
    if choice == 10:
        es.playsound(userid,
                     "zeisenproject/the-killers/sounds/sndMobileclose.mp3",
                     1.0)
        return
    if popupname.startswith("cphonecall"):
        ban_time = int(es.keygetvalue(steamid, "player_data", "ban_time"))
        wait_queue = int(sv('wait_queue'))
        if story == 0:
            port = find_servers()
            if not port:
                esc.tell(userid, "#255,255,255* 모든 서버가 꽉 차있습니다.")
            elif steamid != "142119022" and steamid != "149373723":
                esc.tell(userid, "#255,255,255* 서버가 개방된 상태이나 어드민만 입장할 수 있습니다.")
            elif ban_time > 0:
                esc.tell(
                    userid, "#255,255,255* 현재 서버 입장이 밴된 상태입니다. %s초 남았습니다." %
                    (ban_time))
            elif wait_queue > 0:
                esc.tell(
                    userid,
                    "#255,255,255* 누군가가 이미 서버를 준비를 요청했기에 서버를 동시에 준비할 수 없었습니다. 다시 시도해주세요."
                )
            else:
                es.set("wait_queue", timerz_count + 2)
                dlg = msglib.VguiDialog(title="서버 접속",
                                        msg="themessage",
                                        mode=msglib.VguiMode.MENU)
                dlg["msg"] = "서버 접속"
                dlg['time'] = 10
                rp = random.randint(10000, 99999)
                dlg.addOption(
                    msg="서버에 접속합니다.",
                    command=
                    "connect 1.214.121.137:%s;password random%s;wait 200;password haha"
                    % (port, rp))
                dlg.send(userid)
                rcon_msg(
                    "1.214.121.137:%s" % (port),
                    "es_xdoblock the_killers/server_wait;rcon changelevel cs_gentech_final_zv1;rcon sv_password random%s"
                    % (rp))
                es.keysetvalue(steamid, "player_data", "story", 1)
                es.keysetvalue(steamid, "player_data", "ban_time", 11)
                esc.msg(
                    "#255,255,255[Debug] %s Port is Idle. breaking the while.."
                    % (port))
                esc.msg("#255,255,255[Debug] %s User requested to %s port" %
                        (es.getplayername(userid), port))
    if popupname.startswith("cphonemenu"):
        cphone = popuplib.easymenu('cphonecall_%s' % (userid), None,
                                   cphone_select)
        cphone.settitle("@ Cell Phone")
        cphone.c_stateformat[False] = "%2"

        if story == 0:
            cphone.addoption(0, "오랫동안 삐쩍 말라있었군, 네 형의 죽음 때문인가? 그렇지 않아?", 0)
            for i in range(1, 6 + 1):
                cphone.addoption(0, " ", 0)

            cphone.addoption(0, "너도 의심했다시피, 네 형은 죽지 않았다. 그저 뱀년들의 간단한 트릭일 뿐이지.",
                             0)
            for i in range(1, 6 + 1):
                cphone.addoption(0, " ", 0)

            cphone.addoption(
                0, "네 형을 만나고 싶다면 인천 남구로 와라. 그 곳에 네가 몰랐던 비밀들이 밝혀질 터이니..", 0)
            for i in range(1, 6 + 1):
                cphone.addoption(0, " ", 0)

            for i in range(1, 6 + 1):
                cphone.addoption(0, " ", 0)
            cphone.addoption(story, "그 곳으로 향한다.", 1)
        cphone.send(userid)
예제 #24
0
def keygetvalue(argv):
    sv[argv[0]] = es.keygetvalue(*argv[1:])
예제 #25
0
def wum_handler(userid,choice,popupname):
	wum_playerinfo = popuplib.create("%s%s"%(popups[1],userid))
	wum_playerinfo.menuselect = wum_playerinfo_handler
	wum_playerinfo.addline("->1. %s"%es.getplayername(choice))
	wum_playerinfo.addline("-----------------------")
	wum_playerinfo.addline("TLevel: %s"%es.keygetvalue("wcsuserdata",choice,"total_level"))
	wum_playerinfo.addline("-----------------------")
	race = es.keygetvalue("wcsuserdata",choice,"race")
	wum_playerinfo.addline("o %s : %s"%(es.keygetvalue("wcsraces",race,"name"),es.keygetvalue("wcsuserdata",choice,"level")))
	numberofskills = int(es.keygetvalue("wcsraces",race,"numberofskills"))
	if numberofskills > 0:
		counter = 1
		scounter = 0
		skillnames = es.keygetvalue("wcsraces",race,"skillnames").split("|")
		while counter <= numberofskills:
			level = es.keygetvalue("wcsuserdata",choice,"skill_%s"%(counter))
			if not level or level == 0:
				level = 0
			wum_playerinfo.addline("- %s : %s"%(skillnames[scounter],level))
			scounter += 1
			counter += 1
	wum_playerinfo.addline("-----------------------")
	skulls = 0
	if es.keygetvalue("wcsuserdata",choice,"skulls"): skulls = int(es.keygetvalue("wcsuserdata",choice,"skulls"))
	if skulls and skulls != 0:
		wum_playerinfo.addline("- skulls: %s%%"%skulls)
	speed = 0
	if es.keygetvalue("wcsuserdata",choice,"speed"): speed = float(es.keygetvalue("wcsuserdata",choice,"speed"))
	if speed and speed != 0:
		speed = int(round(speed * 100))
		if speed != 100 and speed != 0: wum_playerinfo.addline("- speed: %s%%"%speed)
	gravity = 0
	if es.keygetvalue("wcsuserdata",choice,"gravity"): gravity = float(es.keygetvalue("wcsuserdata",choice,"gravity"))
	if gravity and gravity > 0:
		gravity = int(round(gravity * 100))
		if gravity != 100 and gravity != 0: wum_playerinfo.addline("- gravity: %s%%"%gravity)
	longjump = 0
	if es.keygetvalue("wcsuserdata",choice,"longjump"): longjump = float(es.keygetvalue("wcsuserdata",choice,"longjump"))
	if longjump and longjump > 0:
		longjump = int(round(longjump * 100))
		if longjump != 100 and longjump != 0: wum_playerinfo.addline("- longjump: %s%%"%longjump)
	invisp = 0
	if es.keygetvalue("wcsuserdata",choice,"invisp"): invisp = float(es.keygetvalue("wcsuserdata",choice,"invisp"))
	if invisp and invisp > 0:
		invisp = int(round(invisp))
		if invisp != 0: wum_playerinfo.addline("- invis: %s%%"%invisp)
	if es.getplayerprop(choice,"CCSPlayer.baseclass.pl.deadflag") == 0:
		wum_playerinfo.addline("- health %s%%"%es.getplayerprop(choice,"CCSPlayer.baseclass.m_iHealth"))
	wum_playerinfo.addline("-----------------------")
	wum_playerinfo.addline("->8. Back")
	wum_playerinfo.addline("->0. Exit")
	for popup in popups:
		if popuplib.exists("%s%s"%(popup,userid)): popuplib.close("%s%s"%(popup,userid),userid)
	gamethread.delayed(0.0001,wum_playerinfo.send,(userid))
예제 #26
0
def genRacelistPop(popupname, callback, userid):
    checkPop(popupname)
    changerace_menu = popuplib.easymenu(popupname, None, callback)
    changerace_menu.settitle('Select Race')
    counter = 1
    counter2 = 0
    while es.exists("key", "wcsraces", counter):
        allow_only = es.keygetvalue("wcsraces", counter, "allow_only")
        steamid = es.getplayersteamid(userid)
        if steamid in allow_only:
            racename = es.keygetvalue("wcsraces", counter, "name")
            ##ADMIN RACE
            if es.keygetvalue("wcsraces", counter, "allow_only") == "<admins>":
                if es.exists("key", "wcsadmin", es.getplayersteamid(userid)):
                    if (es.keygetvalue("wcsuserdata", userid,
                                       "race_%s" % counter) != None):
                        racelevel = es.keygetvalue("wcsuserdata", userid,
                                                   "race_%s" %
                                                   counter).split("|")
                    else:
                        racelevel = 0
                    try:
                        level = int(racelevel[0])
                        if level > 0:
                            racename = racename + " (Level %s)" % racelevel[0]
                        changerace_menu.addoption(counter, racename)
                    except:
                        changerace_menu.addoption(counter, racename)
                else:
                    racename = racename + " - Admin race"
                    changerace_menu.addoption(counter, racename, 0)
            #END ADMIN RACE
            ##PRIVATE RACE
            elif es.keygetvalue("wcsraces", counter, "allow_only") != "0":
                usersa = es.keygetvalue("wcsraces", counter,
                                        "allow_only").split("|")
                if es.getplayersteamid(userid) in usersa:
                    if (es.keygetvalue("wcsuserdata", userid,
                                       "race_%s" % counter) != None):
                        racelevel = es.keygetvalue("wcsuserdata", userid,
                                                   "race_%s" %
                                                   counter).split("|")
                    else:
                        racelevel = 0
                    try:
                        level = int(racelevel[0])
                        if level > 0:
                            racename = racename + " (Level %s)" % racelevel[0]
                        changerace_menu.addoption(counter, racename)
                    except:
                        changerace_menu.addoption(counter, racename)
                else:
                    racename = racename + " - Private race"
                    changerace_menu.addoption(counter, racename, 0)
            #END PRIVATE RACE
            #TOO LOW LEVEL
            elif int(es.keygetvalue(
                    "wcsuserdata", userid, "total_level")) < int(
                        es.keygetvalue("wcsraces", counter, "required_level")):
                levelsneeded = int(
                    es.keygetvalue("wcsraces", counter, "required_level")
                ) - int(es.keygetvalue("wcsuserdata", userid, "total_level"))
                levelsneeded = str(levelsneeded)
                racename = racename + " - %s Levels needed" % levelsneeded
                changerace_menu.addoption(counter, racename, 0)
            #END TOO LOW LEVEL
            elif int(es.keygetvalue("wcsraces", counter,
                                    "restrictteam")) == int(
                                        es.getplayerteam(userid)):
                racename = racename + " - Restricted Team"
                changerace_menu.addoption(counter, racename, 0)
            else:
                racelevel = {}
                if (es.keygetvalue("wcsuserdata", userid, "race_%s" % counter)
                        != None):
                    racelevel = es.keygetvalue("wcsuserdata", userid,
                                               "race_%s" % counter).split("|")
                else:
                    racelevel = 0
                try:
                    level = int(racelevel[0])
                    if level > 0:
                        racename = racename + " (Level %s)" % racelevel[0]
                    changerace_menu.addoption(counter, racename)
                except:
                    changerace_menu.addoption(counter, racename)
            counter2 += 1
        counter += 1
    if counter2 >= 1:
        gamethread.delayed(0.001, changerace_menu.send, userid)
        es.tell(
            userid, "#multi",
            "#greenWARNING:#lightgreen If you change race while you are alive you will die."
        )
    else:
        es.tell(
            userid, "#multi",
            "#green[WCS] #lightgreenYou don't have #greenprivate #lightgreenraces!"
        )
예제 #27
0
def pre_player_hurt(ev):
    userid = int(ev['userid'])
    attacker = int(ev['attacker'])
    dmg_health = int(ev['dmg_health'])
    hitgroup = int(ev['hitgroup'])
    weapon = str(ev['weapon'])
    steamid = getplayerid(userid)
    if attacker > 0:
        attackersteamid = getplayerid(attacker)
    health = es.getplayerprop(userid, _healthprop) + dmg_health

    total_dmg = dmg_health
    if not attacker > 0:  #공격자가 존재하지 않을경우 데미지를 2배 처리
        total_dmg *= 2
    else:  #공격자가 존재하는경우
        if weapon == "knife":
            sz = random.choice([
                "zeisenproject/The-Killers/sounds/sndHit.wav",
                "zeisenproject/The-Killers/sounds/sndHit1.wav",
                "zeisenproject/The-Killers/sounds/sndHit3.wav"
            ])
            for i in range(1, 2 + 1):
                if i == 1: es.playsound(attacker, sz, 1.0)
                else: es.playsound(attacker, sz, 0.5)
        else:
            es.playsound(attacker,
                         "zeisenproject/The-Killers/sounds/sndHit2.wav", 1.0)
        if hitgroup == 1:
            if weapon == "awp":
                total_dmg = 250
            elif weapon == "scout":
                total_dmg = 165
            elif weapon == "p90":
                total_dmg = 70
            else:
                total_dmg = 100
        else:
            if weapon == "knife":
                total_dmg = 100
            else:
                total_dmg = 50
    health -= total_dmg
    es.setplayerprop(userid, _healthprop, health)
    if attacker > 0:
        if steamid == "BOT" and health > 0 and attackersteamid != "BOT":
            gore = bool(es.keygetvalue(attackersteamid, "player_data", "gore"))
            if gore:
                if hitgroup == 1:
                    for i in range(1, 5 + 1):
                        make_blood(userid,
                                   color=0,
                                   amount=10,
                                   headshot=1,
                                   valueat=attacker)
                else:
                    for i in range(1, 5 + 1):
                        make_blood(userid,
                                   color=0,
                                   amount=10,
                                   headshot=0,
                                   valueat=attacker)