Sparrow Posted June 17, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 34 Reputation: 0 Joined: 05/19/12 Last Seen: September 1, 2013 Share Posted June 17, 2012 Еще раз здравствуйте все. Вы наверное уже от меня устали В общем например такой скрипт: location,100,100,1 script Example::ex 90,{ if(.speak == 1) goto sorry; set .speak,1; set .name$,strcharinfo(0); mes "[Example]"; mes "Part of this NPC is free, you can talk to him."; next; mes "[Example]"; mes "The first player is in conversation with the NPC."; next; mes "[Example]"; mes "The first player finishes a conversation with the NPC."; set .speak,0; close; sorry: mes ""; mes "Sorry. Currently, "+.name$+" is talking to the NPC.."; close; } Вроде бы все работает. Но. Если добавить меню. location,100,100,1 script Example::ex 90,{ if(.speak == 1) goto sorry; set .speak,1; set .name$,strcharinfo(0); mes "[Example]"; mes "Part of this NPC is free, you can talk to him."; next; mes "[Example]"; mes "The first player was invited to the menu."; next; switch(select("The first menu item:The second menu item:The third menu item") { case 1: mes "[Example]"; mes "The first player selected first menu item."; set .speak,0; close; case 2: mes "[Example]"; mes "The first player selected the second menu item."; set .speak,0; close; case 3: mes "[Example]"; mes "The first player has chosen the third element of the menu."; set .speak,0; close; sorry: mes ""; mes "Sorry. Currently, "+.name$+" is talking to the NPC.."; close; } Сам по себе образуется баг - когда НПС выдает меню и если не выбирать какой то элемент меню, а выйти из диалога, то переменная .спек не обнулится и никто не сможет больше с этим НПС поговорить. Может кто нибудь сможет придумать как обойти эту проблему? Заранее Спасибо. Quote Link to comment Share on other sites More sharing options...
Lilith Posted June 17, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 407 Reputation: 159 Joined: 11/18/11 Last Seen: November 15, 2014 Share Posted June 17, 2012 (edited) location,100,100,1 script Example::ex 90,{ if(.speak == 1) goto sorry; set .speak,1; set .name$,strcharinfo(0); mes "[Example]"; mes "Part of this NPC is free, you can talk to him."; next; mes "[Example]"; mes "The first player was invited to the menu."; next; switch(select("The first menu item:The second menu item:The third menu item") { case 1: mes "[Example]"; mes "The first player selected first menu item."; set .speak,0; break; case 2: mes "[Example]"; mes "The first player selected the second menu item."; set .speak,0; break; case 3: mes "[Example]"; mes "The first player has chosen the third element of the menu."; set .speak,0; break; } close; sorry: mes ""; mes "Sorry. Currently, "+.name$+" is talking to the NPC.."; break; } Edited June 17, 2012 by Lilith Quote Link to comment Share on other sites More sharing options...
Sparrow Posted June 17, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 34 Reputation: 0 Joined: 05/19/12 Last Seen: September 1, 2013 Author Share Posted June 17, 2012 (edited) Спасибо, но не помогло( Нажимаешь отмена, и все. Крындец =( При нажатии Отмена же нельзя по идее действия выбрать и обнулить переменную при выходе через кнопку отмена( Edited June 17, 2012 by Sparrow Quote Link to comment Share on other sites More sharing options...
Lilith Posted June 18, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 407 Reputation: 159 Joined: 11/18/11 Last Seen: November 15, 2014 Share Posted June 18, 2012 (edited) location,100,100,1 script Example::ex 90,{ if(.speak == 1) goto sorry; set .speak,1; set .name$,strcharinfo(0); mes "[Example]"; mes "Part of this NPC is free, you can talk to him."; next; mes "[Example]"; mes "The first player was invited to the menu."; next; switch(prompt("The first menu item:The second menu item:The third menu item")) { case 1: mes "[Example]"; mes "The first player selected first menu item."; set .speak,0; break; case 2: mes "[Example]"; mes "The first player selected the second menu item."; set .speak,0; break; case 3: mes "[Example]"; mes "The first player has chosen the third element of the menu."; set .speak,0; break; default: set .speak,0; break; } close; sorry: mes ""; mes "Sorry. Currently, "+.name$+" is talking to the NPC.."; break; } Edited June 18, 2012 by Lilith 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.