Akselj Posted December 14, 2008 Author Share Posted December 14, 2008 Hi,I tried to make a custom menu to make a player write "Yes" or "No" if they want to join a faction. So I just started the script and made the part where a custom menu pops up, haven't made the part where faction is set.Nothing happened. Here's the script:```Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call CustomMenuShow(index, "The Red Alliance", "\GUI\CUSTOM\red.jpg", 1) Call CustomMenuLabel(index, 1, "Will you join the Red Alliance?", 20, 50, 10, 0, 0, 400, 20) Call CustomMenuTextBox(index, 1, 300, 20, 100, "Type "Yes" or "No" to answer") Case 1 Call CustomMenuShow(index, "The Blue Alliance", "\GUI\CUSTOM\blue.jpg", 1) Call CustomMenuLabel(index, 2, "Will you join the Blue Alliance?", 20, 50, 10, 0, 0, 400, 20) Call CustomMenuTextBox(index, 2, 300, 20, 100, "Type "Yes" or "No" to answer") Case 2 Call CustomMenuShow(index, "The Yellow Alliance", "\GUI\CUSTOM\yellow.jpg", 1) Call CustomMenuLabel(index, 3, "Will you join the Yellow Alliance?", 20, 50, 10, 0, 0, 400, 20) Call CustomMenuTextBox(index, 3, 300, 20, 100, "Type "Yes" or "No" to answer") Case 3 Call CustomMenuShow(index, "The Green Alliance", "\GUI\CUSTOM\green.jpg", 1) Call CustomMenuLabel(index, 4, "Will you join the Green Alliance?", 20, 50, 10, 0, 0, 400, 20) Call CustomMenuTextBox(index, 4, 300, 20, 100, "Type "Yes" or "No" to answer") Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```Did I do this wrong, use out-dated commands or is custom menus screwed up in EE 2.7?EDIT: Oh, and I used commands from a tut I found. I only edited text. Link to comment Share on other sites More sharing options...
Dastyruck Posted December 14, 2008 Share Posted December 14, 2008 I am not the best scripter, but I assume you need to exit sub after each case. Link to comment Share on other sites More sharing options...
DarkMazer Posted December 15, 2008 Share Posted December 15, 2008 The problem is this:> "Type "Yes" or "No" to answer"It doesn't think those quotes in the middle are quotes, it thinks they're the beginning and end of strings…The proper way to do it is:> "Type ""Yes"" or ""No"" to answer"At least, I think that's the only problem…Also, unless I'm mistaken, text boxes in EE 2.7 won't take in string input anymore, because it could be exploited to run scripts... Link to comment Share on other sites More sharing options...
Akselj Posted December 15, 2008 Author Share Posted December 15, 2008 But the custom menu doesen't show up at all… And /testscipt says scripts are working properly... Link to comment Share on other sites More sharing options...
Zeno Posted December 15, 2008 Share Posted December 15, 2008 The menus will show up if you implement the suggestions.I just tried it, and this works:```Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call CustomMenuShow(index, "The Red Alliance", "\GUI\CUSTOM\Red.jpg", 1) Call CustomMenuLabel(index, 1, "Will you join the Red Alliance?", 20, 50, 10, 0, 0, 400, 20) Call CustomMenuTextBox(index, 1, 300, 20, 100, "Type ""Yes"" or ""No"" to answer") Exit Sub Case 1 Call CustomMenuShow(index, "The Blue Alliance", "\GUI\CUSTOM\Blue.jpg", 1) Call CustomMenuLabel(index, 2, "Will you join the Blue Alliance?", 20, 50, 10, 0, 0, 400, 20) Call CustomMenuTextBox(index, 2, 300, 20, 100, "Type ""Yes"" or ""No"" to answer") Exit Sub Case 2 Call CustomMenuShow(index, "The Yellow Alliance", "\GUI\CUSTOM\yellow.jpg", 1) Call CustomMenuLabel(index, 3, "Will you join the Yellow Alliance?", 20, 50, 10, 0, 0, 400, 20) Call CustomMenuTextBox(index, 3, 300, 20, 100, "Type ""Yes"" or ""No"" to answer") Exit Sub Case 3 Call CustomMenuShow(index, "The Green Alliance", "\GUI\CUSTOM\green.jpg", 1) Call CustomMenuLabel(index, 4, "Will you join the Green Alliance?", 20, 50, 10, 0, 0, 400, 20) Call CustomMenuTextBox(index, 4, 300, 20, 100, "Type ""Yes"" or ""No"" to answer") Exit Sub Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```The menu will come up, unless you don't have the image. In the case that you don't, it will tell you. Link to comment Share on other sites More sharing options...
Mellowz Posted December 15, 2008 Share Posted December 15, 2008 DarkMazer is correct. Make sure your you change **'**"**'** to **'**""**'**, and if you still have a problem, then reply. ;D Link to comment Share on other sites More sharing options...
Akselj Posted December 15, 2008 Author Share Posted December 15, 2008 I still have the problem.EDIT: Solved. After I refreshhed the map it worked. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now