WarMad Posted October 31, 2016 Share Posted October 31, 2016 not sure how to do this but i basically want a one click search the streets which shows a big list of every search done from 1 to what ever you have so if you have 500 you click search and it does them all and you scroll down to see what you found each step then after say the 500th one at the very bottom it shows the amount of money and the amount of crystals you found Quote Link to comment Share on other sites More sharing options...
G7470 Posted October 31, 2016 Share Posted October 31, 2016 [uSER=70347]NonStopCoding[/uSER] / [uSER=67703]adamhull[/uSER] isn't this something that's on GRPG? I can't really remember since it's been so long, but I know I've seen this before somewhere. If so, this could quite easily be translated to MCCodes lite. ~G7470 Quote Link to comment Share on other sites More sharing options...
WarMad Posted October 31, 2016 Author Share Posted October 31, 2016 Yes i beleave it is but I'm not 100% sure and I was gonna try the mccodes one but I don't care for it Quote Link to comment Share on other sites More sharing options...
TheMasterGeneral Posted October 31, 2016 Share Posted October 31, 2016 <?php while ($searchleft > 0) { $db->query("UPDATE `users` SET `searched` = `searched` - 1, `autohex` = `autohex` - 1 WHERE `userid` = $userid"); $searchleft=($searchleft-1); $chance = mt_rand(1,100); if ($chance <= 10) { //Queries, print, etc. } //continue on and on... } That's the basics of it. Quote Link to comment Share on other sites More sharing options...
WarMad Posted October 31, 2016 Author Share Posted October 31, 2016 Thanks I will play with that once I get a chance to ;) Quote Link to comment Share on other sites More sharing options...
WarMad Posted October 31, 2016 Author Share Posted October 31, 2016 Wait isn't that for just 1 at a time? Or is that for say I have 100 of them it will do all 100 because that looks like it would be for only 1 Quote Link to comment Share on other sites More sharing options...
WarMad Posted October 31, 2016 Author Share Posted October 31, 2016 That's without really looking at it to well I'm on mobile Quote Link to comment Share on other sites More sharing options...
AdamHull Posted October 31, 2016 Share Posted October 31, 2016 It does indeed, I have sent him a copy off the search :) 1 Quote Link to comment Share on other sites More sharing options...
TheMasterGeneral Posted October 31, 2016 Share Posted October 31, 2016 (edited) Sorry, allow me to elaborate. I had this instance setup so that the user gets 100 "searches" per day. Database holds the value of 100. Each iteration through, it subtracts 1 from the "search" variable from both the database and the loop. Once the loop hits 0, it finishes. Yes, it will echo out each output. Edited October 31, 2016 by TheMasterGeneral Quote Link to comment Share on other sites More sharing options...
NonStopCoding Posted November 1, 2016 Share Posted November 1, 2016 Add this to your users table ALTER TABLE `users` ADD `searchdowntown` int(3) NOT NULL default 100; searchdowntown.php <?php include(__DIR__ . '/globals.php'); ?> <table class="table" cellspacing="1" style="text-align:center;"> <tr><th>Search Prison Yard</td></th> <tr> <td> <?php $total = 0; if($ir['searchdowntown']) { for($i = 1; $i <= 100; $i++) { echo $i . ".) "; $randnum = mt_rand(0,50); echo (!$randnum) ? "You didn't find anything." : "You found ".money_formatter($randnum)."!"; $total += $randnum; echo "<br />"; } $db->query("UPDATE `users` SET `money` = `money` + ".$total.",`searchdowntown` = 0 WHERE `userid` = ".$userid); echo "You found a total of ".money_formatter($total)." searching the streets!"; } else echo "You have already searched the street as much as you can today."; ?> </td> </tr> </table><?php $h->endpage(); 1 Quote Link to comment Share on other sites More sharing options...
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.