Jump to content

a question about a (if-else)simplified


Go to solution Solved by PACI,

Recommended Posts

Hello, I have set up a task that includes the if-else and is simplified to make the function easier to read.

Anyway, what I want is, how do I add more than one simplified condition?

 

(item.vnum >= 11200 and item.vnum <= 11289 or item.vnum >= 11400 and item.vnum <= 11489 or item.vnum >= 11600 and item.vnum <= 11689 or item.vnum >= 11800 and item.vnum <= 11889 and " yes " or " no ")

 

It only works to specify the last condition if it is yes or no

item.vnum >= 11800 and item.vnum <= 11889

 

Link to comment
Share on other sites

  • Developer
  • Solution

Put the entire condition inside parenthesis:
 

(item.vnum >= 11200 and item.vnum <= 11289 or item.vnum >= 11400 and item.vnum <= 11489 or item.vnum >= 11600 and item.vnum <= 11689 or item.vnum >= 11800 and item.vnum <= 11889) and " yes " or " no "

 

  • Good 1

when you return 0 and server doesn't boot:

unknown.png

Link to comment
Share on other sites

11 hours ago, PACI said:

 

(item.vnum >= 11200 and item.vnum <= 11289 or item.vnum >= 11400 and item.vnum <= 11489 or item.vnum >= 11600 and item.vnum <= 11689 or item.vnum >= 11800 and item.vnum <= 11889) and " yes " or " no "

🤣 Really that easy

thanks you

Edited by AAJ
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.