xcoms Posted February 24, 2013 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 19 Reputation: 1 Joined: 01/20/13 Last Seen: April 7, 2019 Share Posted February 24, 2013 (edited) Друзя помогите разобраться.... есть скрипт дуели ! Работает почти хорошо .. но есть проблема которую не могу решить ... в скрипте есть такой кусочек который должен отключать запрос на дуель по выходу времени ! но ничего не происходит.. можете подсказать почему ?( //If 5 Minutes passed after the challenger registred and no one accepts it. OnTimer10000: announce "Так и не нашелься суперник или вышло время, и к сожалению дуель была отменена .",bc_map|bc_blue; if((.char$ != "") && (attachrid (getcharid(3,.char$)))) { set Zeny,Zeny+(.zeny/2); set dueling,0; } if((.char2$ != "") && (attachrid (getcharid(3,.char2$)))) { set Zeny,Zeny+(.zeny/2); set dueling,0; } // detachrid; set .char$,""; set .char2$,""; set .gambling,0; set .waiting,0; set .zeny,0; stopnpctimer; end; вот скрипт //===== eAthena Script ====================================================================== //= Duel Gambling //===== Original By ========================================================================= //= Information //===== Edited By ========================================================================= //= Kaushik //===== Current Version: ==================================================================== //= 1.4 = Fixed everything by Kaushik //= 1.3 = Added Comments and some Functions //= 1.2 - Fix exploitable bug //= 1.1 - Small Fix //= 1.0 - Script Release //===== Compatible With: ==================================================================== //= Tested in TXT Revision 12168 Trunk //===== Description: ======================================================================== //= You have to set the duel_time_interval to 0 //===== Comments and Credits ================================================================ //= Thanks to Ruroniarc,AnnieRuru,David Boy and Yhn that help me on getitemname2 o.O(getitemname2?) //= Thanks to my friend, Joey for the typo things //= //=========================================================================================== prontera,150,177,4 script Дуель на деньги 953,{ set @npcname$,"[Менеджер дуели]"; L_mm: mes @npcname$; //If already a duel is going on if(.gambling) { mes "Дуель стартовала, пожалуйста дождитесь окончание"; close; } mes callfunc("F_Hi") + " " + strcharinfo(0); //If the challenger and the one accepting the duel have registred and the duel is ready to start if(.char$ == strcharinfo(0) && .char2$ != "") { mes "^0000FF" +.char2$+ "^000000 ждет Вас для начала дуели!"; if(.zeny) mes "Ставка дуели ^FF0000" +.zeny+ "^000000 zeny."; if(.item) mes "The player duel for a ^FF0000" + callfunc("F_getitemname2",.item2[0],.item2[1],.item2[2],.item2[3],.item2[4],.item2[5]) + "^000000"; mes "Что бы Вы хотели?"; next; menu "Начать дуель",L_sduel,"Закрыть дуель",L_cduel; } //If the one accept the duel is going to talk to the npc if(.waiting) { mes "Дуэль будет начата в ближайшее время!"; close; } //If the challenger has registred, speaks again to the npc and no one accepted it if(.char$ == strcharinfo(0)) { mes "Пожалуйста, подождите вашего соперника."; next; menu "Закрыть дуель",L_cduel,"Я подожду",-; close; } //If a challenger has registred, another person speaks to the npc and no one has accepted before if(.char$ != "") { mes "Игрок ждет на поединок"; mes "Что бы Вы хотели?"; next; menu "Игрок и информация дуели",-,"Отправить приглашение на дуэль игроку",L_iduel,"Дуель на деньги?",L_info; mes @npcname$; mes "Игрок который ждет поединок ^0000FF"+.char$+"^000000"; if(.zeny) mes "Дуелт за ^FF0000" +.zeny+ "^000000 зени."; if(.item) mes "Дуель за ^FF0000" + callfunc("F_getitemname2",.item[0],.item[1],.item[2],.item[3],.item[4],.item[5]) + "^000000"; next; goto L_mm; } //If no challenger is registred. else { mes "Ни один игрок не ждет дуели за деньги в настоящее время"; mes "Что бы вы хотели сделать?"; next; menu "Начать дуель",-,"Дуель за деньги?",L_info; set .zeny,callfunc("F_PDZeny",0); Initnpctimer; set .char$,strcharinfo(0); mes @npcname$; mes "Пожалуйста подождите соперника."; announce .char$+ " ждет азартного игрока который отправиться с ним на дуель со ставкой " +.zeny+ " зеней " ,bc_map|bc_blue; close; } //This party will run after someone accepted the challenge of a challenger L_iduel: set .zeny,callfunc("F_PDZeny",.zeny); set .char2$,strcharinfo(0); set .waiting,1; mes @npcname$; mes "Пожалусто подождите я проинформирую вашого соперника."; announce .char$+ ", у вас есть соперник!",bc_map|bc_blue; close; //After both players registred and the challenger starts the duel. L_sduel: mes @npcname$; mes "Мы начинаем дуель."; close2; attachrid getcharid(3,.char2$); warp "pvp_n_1-1",90,50; attachrid getcharid(3,.char$); set dueling,1; warp "pvp_n_1-1",110,50; atcommand "@duel " + .char2$; attachrid getcharid(3,.char2$); atcommand "@accept"; set dueling,1; // detachrid; set .gambling,1; announce .char$+ " начал дуель с " +.char2$+ "!",bc_map|bc_blue; end; //If only the challenger is registred and cancels or if both registred and the challenger cancels the duel. L_cduel: announce "Дуель была отменена игроком " +.char$,bc_map|bc_blue; mes @npcname$; mes "Очень жаль, " + callfunc("F_Bye"); set dueling,0; set Zeny,Zeny+(.zeny/2); close2; if((.char2$ != "") && (attachrid (getcharid(3,.char2$)))) { attachrid getcharid(3,.char2$); set Zeny,Zeny+(.zeny/2); set dueling,0; // detachrid; } set .char$,""; set .char2$,""; set .gambling,0; set .waiting,0; set .zeny,0; end; //If you click on information for the duel. L_info: mes @npcname$; mes "Я собираю двох игроков,"; mes "которые будуть биться на смерть,"; next; mes @npcname$; mes "Перед началом дуели игрок указывает суму,"; mes "за которую игроки будут сражаться."; mes "Победитель получат всё."; next; mes @npcname$; mes "Максимальное время ожидание дуали и дуелянта 5 минут."; next; goto L_mm; //If 5 Minutes passed after the challenger registred and no one accepts it. OnTimer1: announce "Так и не нашелься суперник или вышло время, и к сожалению дуель была отменена .",bc_map|bc_blue; if((.char$ != "") && (attachrid (getcharid(3,.char$)))) { set Zeny,Zeny+(.zeny/2); set dueling,0; } if((.char2$ != "") && (attachrid (getcharid(3,.char2$)))) { set Zeny,Zeny+(.zeny/2); set dueling,0; } // detachrid; set .char$,""; set .char2$,""; set .gambling,0; set .waiting,0; set .zeny,0; stopnpctimer; end; //When a player kills his oppenent. OnPCKillEvent: if(!dueling) end; set Zeny,Zeny+.zeny; atcommand "@leave"; announce strcharinfo(0)+" выиграл в дуели!!! Поздравляем!!",bc_map|bc_blue; warp "prontera",158,184; set dueling,0; attachrid killedrid; set dueling,0; // detachrid; set .char$,""; set .char2$,""; set .gambling,0; set .waiting,0; set .zeny,0; set .waiting,0; warp "prontera",158,184; end; //When a player dies.. (Just incase he doesnt get killed by his oppenent) OnPCDieEvent: if(!dueling) end; if (killerrid == 0) { announce "Дуель была завершена потому что игрок "+strcharinfo(0)+" умер", bc_map|bc_blue; if (strcharinfo(0) == .char$) { attachrid getcharid(3,.char2$); set Zeny,Zeny+.zeny/2; } if (strcharinfo(0) == .char2$) { attachrid getcharid(3,.char$); set Zeny,Zeny+.zeny/2; } atcommand "@leave"; set dueling,0; // detachrid; set .char$,""; set .char2$,""; set .gambling,0; set .waiting,0; set .zeny,0; set .waiting,0; end; } } //Function for gambling for Zeny Function script F_PDZeny { If(!getarg(0)) { mes @npcname$; mes "Какую ставку вы желаете установить?"; next; input .@zeny; If(.@zeny > Zeny || !.@zeny) { mes "У вас недостаточно денег на ставку , пожалуйста приходите когда соверете нужную суму!"; mes "Или просто измените на более низкую!"; close; } set Zeny,Zeny-.@zeny; return .@zeny; } If(getarg(0) > Zeny) { mes "У Вас недостаточно денег на дуель , прихожите когда соберете достаточную суму !"; close; } else set Zeny,Zeny-getarg(0); set .@zeny,getarg(0)*2; return .@zeny; warp "prontera",158,184; } уже разобрался. тему можно удалять ) Edited February 24, 2013 by xcoms Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.