some questions about adding a new custom selection

Alexandria

New member
Messages
341
Points
0
Location
localhost
Hello there.

I would like to add another selection to this code:

http://pastebin.com/LMWcLWQ8

Something like this:

if (select("Yes~ Let's start now.:New custom here.:No, I'll be back later.") == 1) {

But where should my code go when the user choose "New Custom here"?

And also, what does == 1 mean?

Thank you.
 

 
Code:
prontera,150,150,5    script    asdf    100,{if (select("Yes~ Let's start now.:No, I'll be back later.") == 1) {    mes "This is ==1"; // Yes~ Let's start now.    close;}    mes "This is ==2"; //No, I'll be back later.    close;}
why not use something like this:

switch (select("Yes~ Let's start now.:New custom here.:No, I'll be back later.")) {  case 1:  if(checkquest(4000) == -1) setquest 4000;   mes "[Hunter Sherin]";   mes "Listen carefully to the scenarios I describe. When I ask a question, you choose an answer. Pretty simple, don't you think?";   next;   mes "[Hunter Sherin]";   mes "I just want to know how you think about life, and why you want to become a Hunter, so there's no need to be nervous."; close;        case 2: //New custom here    case 3:    mes "[Hunter Sherin]";   mes "Okay...";   mes "Come back";   mes "when you're ready~";   close;}
I always use switch select if i have 3 or more items in one menu. if select if two.

 
Last edited by a moderator:
Use a variable

if (select("Yes~ Let's start now."+.@Var$+":No, I'll be back later.") == 1) {

As far as I know == means is equals to in C Language

 
Last edited by a moderator:
you can view it like this way

select( "option 1", // select() return 1 "option 2", // select() return 2 "option 3", // select() return 3 "Cancel" // select() return 4);
the IF-ELSE in your case is just used to check which option is selected by the users.  the value is determined by the [wiki=select] which return 1,2,3,4......etc ...

and, it's easier to view if you using "," to separate each option for the menu.

 
Last edited by a moderator:
you can view it like this way

select( "option 1", // select() return 1 "option 2", // select() return 2 "option 3", // select() return 3 "Cancel" // select() return 4);
the IF-ELSE in your case is just used to check which option is selected by the users.  the value is determined by the [wiki=select] which return 1,2,3,4......etc ...

and, it's easier to view if you using "," to separate each option for the menu.
Can you tell me where should my code go? Im talking in base on my script:

http://pastebin.com/LMWcLWQ8

Thank you.

 
Back
Top