Описание : После того как терористы поставят бомбу и если вы контро-терорист до неё добрались и будите разминировать как всегда, но тут появится окошко, чтобы если нет времени на разминирование игроку предлагается вариант перерезать проводок синий, жёлтый или красный. Вы всегда можете игнорировать меню или выход, а просто разминировать обычным способом как раньше. Установка : 1. Установка eventscripts , если у вас его нету! 2. Качаем архив cutwires-v1.1.zip 3. Вытаскиваем из архива папку cutwires и копируем её в папку сервера addons\eventscripts 4. В файле autoexec.cfg прописываем вот это es_load keymenu и это es_load cutwires Все с установкой закончили. Выключаем сервер и запускаем заного, если он был включен !!! Bomb Menu на русском by World-Source Описание : После того как терористы поставят бомбу и если вы контро-терорист до неё добрались и будите разминировать как всегда, но тут появится окошко, чтобы если нет времени на разминирование игроку предлагается вариант перерезать проводок синий, жёлтый или красный. Вы всегда можете игнорировать меню или выход, а просто разминировать обычным способом как раньше. 1. Установка eventscripts 2. Качаем архив Bomb Menu 3. Вытаскиваем из архива папку hailmary и копируем её в папку сервера addons\eventscripts 4. В файле autoexec.cfg прописываем вот это es_load hailmary Код 1 Code block config { // set this variable to 1 if you want the terrorists to be able to // choose the wire connected to the detonator (in other words, the // wire that CT's have to cut to quick-defuse the bomb) // set this variable to 0 if you just want a simple random number // generator to pick the wire. es_xsetinfo HM_TSELECT 1
// multiplier for the odds when defusing without a defuse kit (pulling a wire). The odds // of success become 1:(4*HM_MULTIPLIER). // so, if you want a CT to be able to have the same odds whether pulling or cutting, set // this to 1. To make it nearly impossible for CTs to successfully pull a wire, set this // to 100. By default it is 2, making the odds 1:8.
es_xsetinfo HM_MULTIPLIER 2 // set the verbosity level. If you feel like HailMary spams too much, change // this setting appropriately. // // 0 = never say anything at all // 1 = just the bare necessities - remind the CT's when the bomb is planted // that they can cut a wire to defuse (1 line), and also tell info on // wire correctness when a wire is cut. // 2 = all printouts in (1), but with two lines for the CT reminder, and // a notice when a terrorist selects a wire. // 3 = all printouts in (2), but with notices when the bomb planter or // defuser are killed. // es_xsetinfo HM_VERBOSITY 3 // the prefix to place in front of chat from the hailmary addon es_xsetinfo HM_CHATPREFIX [HM] } //==============================================================================
// !!!!!!!!!! DO NOT EDIT BELOW THIS LINE !!!!!!!!!!!!
// TODO: is there a way to make bots cut a wire, if there is not enough time to defuse, and // make them do it intelligently?
block load { es_xsetinfo HM_VERSION 1.4BETA
es_xsetinfo hailmary_version 1.5 es_makepublic hailmary_version
// import the user's configs es_xdoblock hailmary/config
// needed for popup menus es_load corelib es_load popup
// create the popup menu for the CTs popup create HM_MENU popup addline HM_MENU "Продолжайте или обрежте провод:" popup addline HM_MENU "[0] Продолжить" popup addline HM_MENU "[1] Красный" popup addline HM_MENU "[2] Зеленый" popup addline HM_MENU "[3] Голубой" popup addline HM_MENU "[4] Желтый" popup select HM_MENU 0 hailmary/nowire popup select HM_MENU 1 hailmary/redwire popup select HM_MENU 2 hailmary/greenwire popup select HM_MENU 3 hailmary/bluewire popup select HM_MENU 4 hailmary/yellowwire
// create a popup menu for the Ts popup create HM_MENU_T popup addline HM_MENU_T "Выберите провод:" popup addline HM_MENU_T "[0] Случайный выбор" popup addline HM_MENU_T "[1] Красный" popup addline HM_MENU_T "[2] Зеленый" popup addline HM_MENU_T "[3] Голубой" popup addline HM_MENU_T "[4] Желтый" popup select HM_MENU_T 0 hailmary/nowire_t popup select HM_MENU_T 1 hailmary/redwire_t popup select HM_MENU_T 2 hailmary/greenwire_t popup select HM_MENU_T 3 hailmary/bluewire_t popup select HM_MENU_T 4 hailmary/yellowwire_t
//es_xmsg #green Hailmary addon loaded.
es_xdoblock hailmary/inithm
}
block unload { es_xdoblock hailmary/killpopup popup delete HM_MENU popup delete HM_MENU_T }
block inithm { es_xsetinfo HM_BOMBENTITY 0 es_xsetinfo HM_DEFUSERID -1 es_xsetinfo HM_PLANTERID -1 es_xsetinfo HM_DEFUSERNAME "NONAMETAS" es_xsetinfo HM_PLANTERNAME "NONAMETAS" es_xsetinfo HM_BOMBPOS 0 es_xsetinfo HM_CUTWIRE 0 es_xsetinfo HM_WIRE 0 es_xsetinfo HM_WIRECOLOR "никакой" es_xsetinfo HM_ISDEAD 0 es_xsetinfo HM_DEFUSERHASKIT 0 es_xsetinfo HM_CUTWIRECOLOR "никакой" es_xsetinfo HM_ACTION "разрез" es_xsetinfo HM_EXPLODING 0 es_xsetinfo HM_PULLODDS 4 es_math HM_PULLODDS * server_var(HM_MULTIPLIER) }
event round_start { es_xdoblock hailmary/inithm }
event round_end { // just an extra cleanup; probably not needed but.... es_xdoblock hailmary/killpopup }
event bomb_beginplant { // use a random number generator to set the wire color that will successfully defuse the bomb. This // is so that if the planter does not choose a wire, one is randomly // chosen for him. es_xrand HM_WIRE 1 4 es_xdoblock hailmary/setHM_WIRECOLOR
// save off who is doing the planting es_setinfo HM_PLANTERNAME event_var(es_username) es_setinfo HM_PLANTERID event_var(userid)
// send a menu to the planter, to let them choose the wire color that // will detonate if (server_var(HM_TSELECT) != 0) do { es popup send HM_MENU_T event_var(userid) } }
event bomb_abortplant { es_xsetinfo HM_PLANTERNAME "noname" es_xsetinfo HM_PLANTERID -1 es_xdoblock hailmary/killpopup }
event bomb_planted { // take down the popup; the T has lost his chance to choose wires. es_xsetinfo HM_PLANTERNAME "noname" es_xsetinfo HM_PLANTERID -1 es_xdoblock hailmary/killpopup
// remind the CTs that they can defuse by cutting or pulling wires. if (server_var(HM_VERBOSITY) > 0) do { es_msg #multi #green server_var(HM_CHATPREFIX) #default CTs: Вы можете быстро обезвредить бомбу, обрезав провод. } if (server_var(HM_VERBOSITY) > 1) do { es_msg #multi #green server_var(HM_CHATPREFIX) #default Если вы обрежете не тот провод, бомба сразу же взорвется. } // DEBUG //es_msg You should cut the server_var(HM_WIRECOLOR) wire, wire server_var(HM_WIRE) }
event bomb_begindefuse { es_xgetentityindex HM_BOMBENTITY planted_c4 es_getindexprop HM_BOMBPOS server_var(HM_BOMBENTITY) "CPlantedC4.baseclass.baseclass.m_vecOrigin"
// save the player ID that is doing the defusing. es_setinfo HM_DEFUSERID event_var(userid) es_setinfo HM_DEFUSERNAME event_var(es_username) es_setinfo HM_DEFUSERHASKIT event_var(haskit)
// here, pop the menu that allows the player to choose whether or not // to cut a wire. If they have a kit, they can cut the wire. If they do // not, they have to pull the wire, which gives a 50/50 chance of setting off // the bomb even if it is the right wire. if (event_var(haskit) == 0) do { popup modline HM_MENU 1 "Продолжайте или обрежте провод:" es_xsetinfo HM_ACTION "обрезать" } else do { popup modline HM_MENU 1 "Продолжайте или обрежте провод:" es_xsetinfo HM_ACTION "обрезать" }
es popup send HM_MENU event_var(userid)
}
event bomb_abortdefuse { es_getplayerprop HM_ISDEAD event_var(es_username) "CCSPlayer.baseclass.pl.deadflag" if (server_var(HM_ISDEAD) == 0) do { if (server_var(HM_EXPLODING) == 0) do { if (server_var(HM_VERBOSITY) > 2) do { es_msg #multi #green server_var(HM_CHATPREFIX) #default event_var(es_username) только что перестал обезвреживать бомбу. } } }
// take down the menu. es_xdoblock hailmary/killpopup
es_xsetinfo HM_DEFUSERID -1 es_xsetinfo HM_DEFUSERNAME "NONAMETAS" es_xsetinfo HM_DEFUSERHASKIT 0
}
event player_death { if (event_var(euserid) == server_var(HM_DEFUSERID)) do { if (server_var(HM_VERBOSITY) > 2) do { es_msg #multi #green server_var(HM_CHATPREFIX) #default Тот, кто разряжал бомбу event_var(es_username), был убит! } es_xdoblock hailmary/killpopup }
if (event_var(userid) == server_var(HM_PLANTERID)) do { if (server_var(HM_VERBOSITY) > 2) do { es_msg #multi #green server_var(HM_CHATPREFIX) #default Тот, кто установил бомбу event_var(es_username), был убит! } es_xdoblock hailmary/killpopup } }
block nowire_t { es_xdoblock hailmary/killpopup es_xdoblock hailmary/setwire }
block redwire_t { es_xsetinfo HM_WIRE 1 es_xdoblock hailmary/setHM_WIRECOLOR es_xdoblock hailmary/setwire }
block greenwire_t { es_xsetinfo HM_WIRE 2 es_xdoblock hailmary/setHM_WIRECOLOR es_xdoblock hailmary/setwire }
block bluewire_t { es_xsetinfo HM_WIRE 3 es_xdoblock hailmary/setHM_WIRECOLOR es_xdoblock hailmary/setwire }
block yellowwire_t { es_xsetinfo HM_WIRE 4 es_xdoblock hailmary/setHM_WIRECOLOR es_xdoblock hailmary/setwire }
block nowire { es_xdoblock hailmary/killpopup }
block redwire { es_xsetinfo HM_CUTWIRE 1 es_xsetinfo HM_CUTWIRECOLOR "red" es_xdoblock hailmary/cutwire }
block greenwire { es_xsetinfo HM_CUTWIRE 2 es_xsetinfo HM_CUTWIRECOLOR "green" es_xdoblock hailmary/cutwire }
block bluewire { es_xsetinfo HM_CUTWIRE 3 es_xsetinfo HM_CUTWIRECOLOR "blue" es_xdoblock hailmary/cutwire }
block yellowwire { es_xsetinfo HM_CUTWIRE 4 es_xsetinfo HM_CUTWIRECOLOR "yellow" es_xdoblock hailmary/cutwire }
block setwire { if (server_var(HM_VERBOSITY) > 1) do { es_msg #multi #green server_var(HM_CHATPREFIX) #default server_var(HM_PLANTERNAME) выбрал провод для детонатора. } //es_msg and that wire is server_var(HM_WIRECOLOR) }
block cutwire { if (server_var(HM_DEFUSERID) > -1) do // if the defuser is defined { es_getplayerprop HM_ISDEAD server_var(HM_DEFUSERID) "CCSPlayer.baseclass.pl.deadflag" if (server_var(HM_ISDEAD) == 0) do // and if the defuser is not dead { if (server_var(HM_VERBOSITY) > 0) do { es_msg #multi #green server_var(HM_CHATPREFIX) #default server_var(HM_DEFUSERNAME) server_var(HM_ACTION) server_var(HM_CUTWIRECOLOR) провод. } //es_msg right wire is server_var(HM_WIRE), cut wire is server_var(HM_CUTWIRE)
// if the wire that was cut and the detonator wire match, then the // bomb is instantly defused, UNLESS the defuser does not have a kit. // In that case, the defuser pulled the wire, which means that there // is a 50-50 chance it will still detonate, even though he chose the // correct wire. if (server_var(HM_CUTWIRE) == server_var(HM_WIRE)) do { es_xsetinfo HM_DICEROLL 1 es_xsetinfo HM_DESCRIBE "a wire cut (1:4 odds)" if (server_var(HM_DEFUSERHASKIT) == 0) do { es_rand HM_DICEROLL 1 server_var(HM_MULTIPLIER) //es_msg rolling the dice... server_var(HM_DICEROLL) //es_format HM_DESCRIBE a gutsy wire pull (1:server_var(HM_PULLODDS) odds) es_format HM_DESCRIBE "a gutsy wire pull (1:%1 odds)" server_var(HM_PULLODDS) } if (server_var(HM_DICEROLL) == 1) do { // defuse the bomb immediately if (server_var(HM_VERBOSITY) > 0) do { es_msg #multi #green server_var(HM_CHATPREFIX) #default The bomb has been defused by server_var(HM_DESCRIBE) by server_var(HM_DEFUSERNAME) } es_setindexprop server_var(HM_BOMBENTITY) "CPlantedC4.m_flDefuseCountDown" 1.0 } else do { // explode the bomb es_xsetinfo CheapBombTimer_TotalBeeps -1 es_xsetinfo HM_EXPLODING 1 if (server_var(HM_VERBOSITY) > 0) do { es_msg #multi #green server_var(HM_CHATPREFIX) #default Это был правильный выбор, но вы не успели! } es_setindexprop server_var(HM_BOMBENTITY) "CPlantedC4.m_flC4Blow" 1.0 } } else do { // explode the bomb es_xsetinfo HM_EXPLODING 1 es_xsetinfo CheapBombTimer_TotalBeeps -1 if (server_var(HM_VERBOSITY) > 0) do { es_msg #multi #green server_var(HM_CHATPREFIX) #default server_var(HM_WIRECOLOR) провод был проводом детонатора;( } es_setindexprop server_var(HM_BOMBENTITY) "CPlantedC4.m_flC4Blow" 1.0 } } } }
// the only purpose of this function is to map a numerical color id to // a text color, so that we can output to screen which color was the // right one. block setHM_WIRECOLOR { if (server_var(HM_WIRE) == 1) do { es_xsetinfo HM_WIRECOLOR red } else do { if (server_var(HM_WIRE) == 2) do { es_xsetinfo HM_WIRECOLOR green } else do { if (server_var(HM_WIRE) == 3) do { es_xsetinfo HM_WIRECOLOR blue } else do { if (server_var(HM_WIRE) == 4) do { es_xsetinfo HM_WIRECOLOR yellow } else do { es_xsetinfo HM_WIRECOLOR Unknown } } } } }
block killpopup { //es popup close HM_MENU server_var(HM_DEFUSERNAME) es popup unsendname HM_MENU #all es popup unsendname HM_MENU_T #all } Код 2 Code import es import playerlib,popuplib from random import randrange
info = es.AddonInfo() info.name = "Hail Mary" info.version = "1.5P" info.author = "*XYZ*SaYnt" info.url = "http://addons.eventscripts.com/addons/view/hailmary" info.basename = "hailmary" info.description = "allows the CTs to try to pull wires to defuse the bomb, in addition to regular defusing."
# global variables conf = {}
############################################################################### ## User Configuration Section ############################################################################### def config(): #set this variable to 1 if you want the terrorists to be able to #choose the wire connected to the detonator (in other words, the #wire that CT's have to cut to quick-defuse the bomb) #set this variable to 0 if you just want a simple random number #generator to pick the wire. conf['tselect'] = 1
#multiplier for the odds when defusing without a defuse kit (pulling a wire). The odds #of success become 1:(4*HM_MULTIPLIER). #so, if you want a CT to be able to have the same odds whether pulling or cutting, set #this to 1. To make it nearly impossible for CTs to successfully pull a wire, set this #to 100. By default it is 2, making the odds 1:8.
conf['multiplier'] = 2 # set the verbosity level. If you feel like HailMary spams too much, change # this setting appropriately. # # 0 = never say anything at all # 1 = just the bare necessities - remind the CT's when the bomb is planted # that they can cut a wire to defuse (1 line), and also tell info on # wire correctness when a wire is cut. # 2 = all printouts in (1), but with two lines for the CT reminder, and # a notice when a terrorist selects a wire. # 3 = all printouts in (2), but with notices when the bomb planter or # defuser are killed. # conf['verbosity'] = 1 # the prefix to place in front of chat from the hailmary addon conf['chatprefix'] = "[HM]" ###############################################################################
hminfo = {} wirecolor = {1:"Красный",2:"Зеленый",3:"Голубой",4:"Желтый"}
def load(): es.set("hailmary_version",info.version) es.makepublic("hailmary_version") #import the user's configs config()
#create the popup menu for the CTs ct_menu = popuplib.create('ct_menu') ct_menu.addline("Продолжайте или обрежте провод:") ct_menu.addline("[0] Продолжать") ct_menu.addline("[1] Красный") ct_menu.addline("[2] Зеленый") ct_menu.addline("[3] Голубой") ct_menu.addline("[4] Желтый") ct_menu.menuselect = ct_menuselect ct_menu2 = popuplib.create('ct_menu2') ct_menu.addline("Продолжайте или обрежте провод:") ct_menu.addline("[0] Продолжать") ct_menu.addline("[1] Красный") ct_menu.addline("[2] Зеленый") ct_menu.addline("[3] Голубой") ct_menu.addline("[4] Желтый") ct_menu.menuselect = ct_menuselect
#create a popup menu for the Ts t_menu = popuplib.create('t_menu') t_menu.addline("Выберите провод для детонатора:") t_menu.addline("[0] Случайный выбор") t_menu.addline("[1] Красный") t_menu.addline("[2] Зеленый") t_menu.addline("[3] Голубой") t_menu.addline("[4] Желтый") t_menu.menuselect = t_menuselect inithm() es.regsaycmd("hailmary","hailmary/hailmary","HailMary debugging")
def hailmary(): userid = es.getcmduserid() killpopup() popuplib.send('t_menu',str(userid))
def unload(): killpopup() popuplib.delete('ct_menu') popuplib.delete('ct_menu2') popuplib.delete('t_menu')
def inithm(): hminfo['defuserid'] = '-1' hminfo['planterid'] = '-1' hminfo['defusername'] = "noname" hminfo['plantername'] = "noname" hminfo['wire'] = 0 hminfo['exploding'] = 0 hminfo['pullodds'] = 4*conf['multiplier'] hminfo['action'] = 'cut'
def round_start(ev): inithm()
def round_end(ev): killpopup()
def bomb_beginplant(ev): #use a random number generator to set the wire color that will successfully #defuse the bomb. This is so that if the planter does not choose a wire, # one is randomly chosen for him. hminfo['wire'] = randrange(1,4)
# save off who is doing the planting hminfo['planterid'] = ev['userid'] hminfo['plantername'] = ev['es_username']
# send a menu to the planter, to let them choose the wire color that # will detonate if conf['tselect']: popuplib.send('t_menu',ev['userid'])
def bomb_abortplant(ev): no_more_t_menu()
def no_more_t_menu(): hminfo['planterid'] = "noname" hminfo['plantername'] = '-1' killpopup()
def no_more_ct_menu(): hminfo['defuserid'] = "noname" hminfo['defusername'] = '-1' killpopup() def bomb_planted(ev): #take down the popup; the T has lost his chance to choose wires. no_more_t_menu()
#remind the CTs that they can defuse by cutting or pulling wires. message("CTs: Вы можете быстро обезвредить бомбу, обрезав провод.") message("Если вы обрежете не тот провод, бомба сразу же взорвется.") #message("Обман: вы должны обрезать %s провод" % wirecolor[hminfo['wire']])
def bomb_begindefuse(ev): bombentity = hminfo['bombentity'] = es.getentityindex("planted_c4") bombpos = es.getindexprop(bombentity,"CPlantedC4.baseclass.baseclass.m_vecOrigin")
#save the player ID that is doing the defusing. hminfo['defuserid'] = ev['userid'] hminfo['defusername'] = ev['es_username'] #here, pop the menu that allows the player to choose whether or not #to cut a wire. If they have a kit, they can cut the wire. If they do #not, they have to pull the wire, which gives a 50/50 chance of setting off #the bomb even if it is the right wire. hminfo['haskit'] = int(ev['haskit']) if ev['haskit'] == '0': popuplib.send('ct_menu2',int(ev['userid'])) hminfo['action'] = 'pulled' else: popuplib.send('ct_menu',int(ev['userid'])) hminfo['action'] = 'cut'
def bomb_abortdefuse(ev): isdead = es.getplayerprop(ev['es_username'],"CCSPlayer.baseclass.pl.deadflag") if isdead == '0': if hminfo['exploding'] == '0': message("%s только что престал обезвреживать бомбу." % ev['es_username'],3)
#take down the menu. no_more_ct_menu()
def player_death(ev): if ev['userid'] == hminfo['defuserid']: no_more_ct_menu() message("Тот, кто разряжал бомбу %s, был убит!" % ev['es_username'],2) if ev['userid'] == hminfo['planterid']: no_more_t_menu() message("Тот, кто устанавливал бомбу %s, был убит!" % ev['es_username'],2)
def t_menuselect(userid,choice,popupid): if choice >= 1 and choice <= 4: hminfo['wire'] = choice message("%s выбрал провод для детонатора."%hminfo['plantername'],3) killpopup()
def message(s,verb=0): if conf['verbosity'] > verb: es.msg("#multi","#green %s #default %s" % (conf['chatprefix'],s)) def ct_menuselect(userid,choice,popupid): if choice >= 1 and choice <= 4: do_cutwire(choice)
def do_cutwire(cutwire): if hminfo['defuserid'] > -1: isdead = es.getplayerprop(hminfo['defuserid'],"CCSPlayer.baseclass.pl.deadflag") if isdead != '0': message("%s %s %s провод" % (hminfo['defusername'],hminfo['action'],wirecolor[cutwire]),0) #if the wire that was cut and the detonator wire match, then the #bomb is instantly defused, UNLESS the defuser does not have a kit. #In that case, the defuser pulled the wire, which means that there #is a 50-50 chance it will still detonate, even though he chose the #correct wire. if hminfo['wire'] == cutwire: dice = 1 describe = "a wire cut (1:4 odds)" if hminfo['haskit'] == 0: dice = randrange(1,conf['multiplier']) describe = "a gutsy wire pull (1:%d odds)" % hminfo['pullodds'] if dice == 1: #defuse the bomb immediately message("Бомбу разрядил%s %s" % (describe,hminfo['defusername'])) es.setindexprop(hminfo['bombentity'],"CPlantedC4.m_flDefuseCountDown",'1.0') else: #explode the bomb explode("Это был правильный выбор, но вы не успели!") else: #explode the bomb explode("Этот %s провод был проводом детонатора;(" % wirecolor[hminfo['wire']])
def explode(m): """ blow the bomb """ message(m) hminfo['exploding'] = 1 #### TODO ###### es_xsetinfo CheapBombTimer_TotalBeeps -1 es.setindexprop(hminfo['bombentity'],"CPlantedC4.m_flC4Blow",'1.0')
def killpopup(): popuplib.unsendname('ct_menu',es.getUseridList()) popuplib.unsendname('ct_menu2',es.getUseridList()) popuplib.unsendname('t_menu',es.getUseridList()) Выключаем сервер и запускаем заного, если он был включен !!! Я проверял всё работает !
|