Haganezuka Posted November 5, 2019 Posted November 5, 2019 Hello rAthena i just want to ask how to enable multiple if else scenario. if(select("Change Hairstyle:Don't Change") == 1) { if (countitem(6707) > 0) { mes "[Kaniki]"; mes "Great, you brought"; mes "a New Kaniki Hair Style Coupon!"; mes "Alright, which hairstyle"; mes "did you want to have?"; next; if (Sex == SEX_MALE) { if(select("Emergency Heal Perm:Aura Blade Cut:Jupon Katana:Jupitel Thunder:Deadly Poison:Earth Spike") == 1) { delitem 6707,1; // New_Style_Coupon setlook 1,24; }else{ delitem 6707,1; // New_Style_Coupon setlook 1,25; }else{ delitem 6707,1; // New_Style_Coupon setlook 1,26; }else{ delitem 6707,1; // New_Style_Coupon setlook 1,27; }else{ delitem 6707,1; // New_Style_Coupon setlook 1,28; }else{ delitem 6707,1; // New_Style_Coupon setlook 1,29; } Quote
0 Moooooon-Aisha Posted November 5, 2019 Posted November 5, 2019 (edited) else if(){ ... } else if(){ ... } else{ ... } Better if you use switch switch(select(...)){ case 1: ... break; case 2: ... break; case 3: ... break; case 4: ... break; } end; Edited November 5, 2019 by OppaiDragon 1 Quote
0 Zell Posted November 5, 2019 Posted November 5, 2019 I think he wants something like this: if( SEX == SEX_MALE ) { setarray .@hair_name$[1],"Emergency Heal Perm", "Aura Blade Cut", "Jupon Katana", "Jupitel Thunder", "Deadly Poison"," Earth Spike"; setarray .@hair_style[1],24, 25, 26, 27, 28, 29; } .@option = select( implode( .@hair_name$, ":" ) ); .@option--; delitem 6707,1; setlook 1,.@hair_style[.@i]; {/code] 1 Quote
0 Haganezuka Posted November 5, 2019 Author Posted November 5, 2019 thanks @OppaiDragon and @Zell now i don't know how which one am i gonna pick. Quote
0 Moooooon-Aisha Posted November 5, 2019 Posted November 5, 2019 10 hours ago, wakefield21 said: thanks @OppaiDragon and @Zell now i don't know how which one am i gonna pick. Both will work just fine, whichever will suit your taste. Quote
Question
Haganezuka
Hello rAthena i just want to ask how to enable multiple if else scenario.
if(select("Change Hairstyle:Don't Change") == 1) { if (countitem(6707) > 0) { mes "[Kaniki]"; mes "Great, you brought"; mes "a New Kaniki Hair Style Coupon!"; mes "Alright, which hairstyle"; mes "did you want to have?"; next; if (Sex == SEX_MALE) { if(select("Emergency Heal Perm:Aura Blade Cut:Jupon Katana:Jupitel Thunder:Deadly Poison:Earth Spike") == 1) { delitem 6707,1; // New_Style_Coupon setlook 1,24; }else{ delitem 6707,1; // New_Style_Coupon setlook 1,25; }else{ delitem 6707,1; // New_Style_Coupon setlook 1,26; }else{ delitem 6707,1; // New_Style_Coupon setlook 1,27; }else{ delitem 6707,1; // New_Style_Coupon setlook 1,28; }else{ delitem 6707,1; // New_Style_Coupon setlook 1,29; }
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.