Lucky9 Clear Challenge Problem

Started on the old forum in May 2010 · view the original in the archive · old links redirect here

2 replies · 645 views · started 16 years ago · 1 min read

3 participants
l0rdrayven Developer · 83 posts #1

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..

}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&rid=$rid&rpw=&time=".time()."\">Back To Room</a><br/>";
echo "<a href=\"index.php?do=chat&sid=$sid\">Chatrooms</a> <a href=\"index.php?do=forums&sid=$sid\">Forums</a> <a href=\"index.php?do=main&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.!

Not i rip persons off i will also do your arse !

thanatos Senior · 261 posts #2

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

something else Fellow · 2,296 posts #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:

}else if($sino[1]=='2') 
{ 
  echo "You cannot clear the challenge if its your turn!";

eg:

}else if($sino[1]=='2') 
{ 
  echo "You cannot clear the challenge if its your turn!";
$shtfl = time() + 60; // time + 60 seconds

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close