Jump to content

[SOLVED] script issue?


2DaysAway

Recommended Posts

This script has been the same for years and is a common script for two other pages and they seem to be working fine. It keeps telling me "I don't have enough turns" when I do. I even checked in the DB and the turns are there. I put in a script to even tell me how many turns I had and that worked on the same page. Any ideas????

 

$user = mysql_fetch_array(mysql_query("SELECT turn,cash,thugs,hoes,medicine,lowrider,worth,ak47,informant,upper,lower FROM `{$tab[pimp]}` WHERE `id`='$id' AND `rid`='$rid';"));
if (isset($_REQUEST["keyboard"])) $keyboard=$_REQUEST["keyboard"]; else $keyboard="";
if (isset($_REQUEST["location"])) $location=$_REQUEST["location"]; else $location="";
if (isset($_REQUEST["turns"])) $turns=$_REQUEST["turns"]; else $turns="";
$error="";

if(($keyboard=="enter") && ($turns > 0))
  {
      if (($turns > $user["turn"]) || ($turns < 0) || (!preg_match('/^[0-9][0-9]*$/i', $turns)))
         { $error="You dont have enough turns!"; }
    elseif($turns > 60){$error="you can only use up to 60 turns!";}
elseif($turns <= 9){$error="you have to use 10 or higher!";}
    else {
         srand ((double) microtime() * 1000000);

         //WHORE SCOUT
         $scouts=$turns;
         while ($scouts>0){
                   if($scouts > 25){
                      $hoe=round($hoe+(rand(4,));
				  $thug=round($thug+(rand(6,9)));
                      $scouts=($scouts-25);
                     }
				 if($scouts > 15){
                      $hoe=round($hoe+(rand(3,6)));
				  $thug=round($thug+(rand(3,6)));
                      $scouts=($scouts-15);
                     }
               elseif($scouts >= 10){
                      $hoe=round($hoe+(rand(2,4)));
				  $thug=round($thug+(rand(0,3)));
                      $scouts=($scouts-10);
                     }
               elseif($scouts >= 5){
                      $hoe=round($hoe+(rand(0,2)));
				  $thug=round($thug+(rand(0,3)));
                      $scouts=($scouts-5);
                     }
                 else{
                      $hoe=round($hoe+(rand(0,$scouts)));
				  $thug=round($thug+(rand(0,$scouts)));
                      $scouts=($scouts-$scouts);
                     }
         }

Link to comment
https://forums.phpfreaks.com/topic/130614-solved-script-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.