Jump to content
MakeWebGames

one click search the streets


WarMad

Recommended Posts

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

Link to comment
Share on other sites

[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

Link to comment
Share on other sites

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.

UmJF8Y5.jpg

Edited by TheMasterGeneral
Link to comment
Share on other sites

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();
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...