EineyEntertainment Posted March 27, 2009 Posted March 27, 2009 I was wondering...is there a way to have the same case catch a different number? For example rand(1,10) Case 1: Blah Blah Case 2,3,4,5: Yada yada Case 6,7,8,9,10: Pikachu For some reason, I though AND would work, but it keeps looping the first case lol. TY in advance Quote
TMan Posted March 27, 2009 Posted March 27, 2009 Re: Multiple Cases switch($_GET['action']) { case "buy1": buy_1(); break; } function buy_1() { blah blah blah } Not sure if that's what your looking for Quote
EineyEntertainment Posted March 27, 2009 Author Posted March 27, 2009 Re: Multiple Cases Nah, but I'll use that one later I'm more so looking for a way to change around the streets or lucky boxes to make some item really rare to find, vs me having to copy and paste the same thing over and over :) Quote
Lithium Posted March 27, 2009 Posted March 27, 2009 Re: Multiple Cases try something along this lines... $rare = rand(111,1111); if ($rare = 666) { give rare item; exit; } else { $go = rand(1,10) switch($go) { case ($go=='1'): blah blah; break; case ($go=='2' || $go=='3' || $go=='4' || $go=='5'): Yada yada; break; } Quote
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.