Trader Menu based on humanity

if i would use if commands i would end up using:
If Else If Else If Else ...
so i rather use switch case this will keep it simpler. Dont know if faster but definitely easier, even that i want one condition to be true
 
Basically true and correct, but he has more then one statement as he said. :) By the way: If you use "exitWith" you maybe want to use [] spawn {}; instead of call.
Nope spawn runs beside all other code, for call the script runs first the call and after that all following code.
so if i need a variable or something from the switch it has to be a call.

if i would use if commands i would end up using:
If Else If Else If Else ...
so i rather use switch case this will keep it simpler. Dont know if faster but definitely easier, even that i want one condition to be true

nope, you should use the " call { if () exitwith {}; }" thing, not thousends of "if else" :)
 
Nope spawn runs beside all other code, for call the script runs first the call and after that all following code.
so if i need a variable or something from the switch it has to be a call.

We should continue this privately or on a teamspeak server, if you want to, because we're kinda spamming this Topic :D
 
german is great :D
but i think i will keep it with switch case :p :D
Thanks for the help anyway i will open another thread if i want to get a cleaner and faster script^^
 
just my 2 cents but else if seems to be faster then switch case, i tested it with a switch case with 100 switches that display text and called the last switch, i did the same with else if's and called the last else if, it seems in the instance of switch case the code checks every switch one by one and checks its value starting at the top and moving down and on a 100 option switch case it took a few seconds delay to actually display the text , however the else if was almost instant....weird since both code requires that each case/else is checked?
 
Back
Top