Lucky9 Clear Challenge Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Lucky9 Clear Challenge Problem

    Guys pls do fix this out..It is working but the problem is when you clear the lucky9 challenge and its your turn it prompts the message something like this one.

    You Cannot Clear The Challenge When Its Your Turn!!Lucky9 Challenge Cleared Successfully.

    instead of "You cannot clear the challenge when its your turn" only
    heres the code of lucky9 clear challenge..


    PHP Code:
    }else if ($do=="clucky9")           
    {
      echo 
    "<head>";
      echo 
    "<title>Lucky9</title>";
      echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"$theme[0]\"/>";
      echo 
    "</head>";
    addonline($uid,"Chatting at Lucky9","index.php?do=chat");
          
      echo 
    "<div align=\"center\"><div class=\"head\">Clear Challenge</div>";

      echo 
    "<br/>";
     
    $isgame mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_lucky9 WHERE chatter='".$uid."'"));
     if(
    $isgame[0]>=1)
     {
      
    $sino mysql_fetch_array(mysql_query("SELECT time, accepted, time2 FROM ibwf_lucky9 WHERE chatter='".$uid."'"));
    if(
    $sino[1]=='1')
    {
    $shtfl $sino[0]+120;
    }else if(
    $sino[1]=='2')
    {
      echo 
    "You cannot clear the challenge if its your turn!";
    }else if(
    $sino[1]=='3')
    {
    $shtfl $sino[2]+120;
    }
    $tm time();
        if(
    $shtfl<$tm)
        {
      
    $res mysql_query("DELETE FROM ibwf_lucky9 WHERE chatter='".$uid."'");
      if(
    $res)
      {
      echo 
    "Lucky9 challenge cleared successfully";
      }else{
      echo 
    "Database Error!";
      }
         }else{
      
    $tm time();
      
    $rema $shtfl $tm;
      
    $num $rema/86400;
      
    $days intval($num);
      
    $num2 = ($num $days)*24;
      
    $hours intval($num2);
      
    $num3 = ($num2 $hours)*60;
      
    $mins intval($num3);
      
    $num4 = ($num3 $mins)*500;
      
    $secs intval($num4);
    echo 
    "Please wait after ";
    if(
    $mins==6)
    {
    echo 
    $secs."s.";
    }else if((
    $days==0) and ($hours==0))
    {
    echo 
    $mins."min(s), ";
    echo 
    $secs."s.";
    }
         }
     }else{
     echo 
    "You Are Not In Game!";
     }
    echo 
    "<br/><br/><a href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=&amp;time=".time()."\">Back To Room</a><br/>";
    echo 
    "<a href=\"index.php?do=chat&amp;sid=$sid\">Chatrooms</a> <a href=\"index.php?do=forums&amp;sid=$sid\">Forums</a> <a href=\"index.php?do=main&amp;sid=$sid\">Home</a>";
    echo 
    "<div class=\"foot\">PinoyGsm.Net</div>";
      echo 
    "<br/>Page Took ";
    $load microtime();
    print (
    number_format($load,2));
    echo 
    " Seconds";

     echo 
    "</div>";
    echo 
    "</body>"
    when you clear the challenge the challenge still cleared even it is your turn, pls guys help me to fix it,thanks a lot in advance.!

    #2
    Luk closely at ur IF, ELSE IF statement. dz shud b d solution 2 ur prob. }else{ delete query }

    Comment


      #3
      its because you have no amount set to $shtfl so: $shtfl will be less than $tm

      there fore you need to set $shtfl to amount higher than $tm (time) here:
      PHP Code:
      }else if($sino[1]=='2'

        echo 
      "You cannot clear the challenge if its your turn!"
      eg:
      PHP Code:
      }else if($sino[1]=='2'

        echo 
      "You cannot clear the challenge if its your turn!";
      $shtfl time() + 60// time + 60 seconds 

      Comment

      Working...
      X