Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Is custom menus screwed up in EE 2.7?


Akselj
 Share

Recommended Posts

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 Select
End 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

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

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 Select
End 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...