Thread: My programming
View Single Post
Old 12-06-2008, 05:16 AM   #1 (permalink)
KingOfTheSouth
The Acquainted
 
KingOfTheSouth's Avatar
 
Join Date: Oct 2008
Location: Cincinnati
Posts: 151
Thanks: 14
KingOfTheSouth is on a distinguished road
Default My programming

Hello again everyone I have a new problem I just made a new feature for my game. But I am having a problem adding a timer in the code. Here is the code if you could help me it would be much appreciated.
php Code:
<?
include("game_html.php");$game="yes";
mysql_query("UPDATE $tab[pimp] SET currently='At the hospital', online='$time' WHERE id='$id' AND rid='$rid'");


$user = mysql_fetch_array(mysql_query("SELECT * FROM $tab[pimp] WHERE id='$id' AND rid='$rid';"));
$hospital = mysql_fetch_array(mysql_query("SELECT * FROM hospital WHERE id='$id' AND rid='$rid';"));


if($doit)

    {

    $afford = $heal * 500;

        if ($user[cash] < $afford)
         { $msg="You dont have that much cash!"; }
        elseif ($user[cash] <= 0)
         { $msg="You dont have that much cash!"; }
        elseif ($heal == 0)
         { $msg="You havent entered an amount to heal"; }
        elseif (!preg_match('/^[0-9][0-9]*$/i', $heal))
         { $msg="dont do that.....";}

        else
        {
         $msg="Bouncers have been healed!";

                    if($heal == $hospital[in_bounce])
                    {
                    mysql_query("UPDATE $tab[pimp] SET thugs=thugs+$heal, cash=cash-$afford WHERE id='$id' AND rid='$rid'");
                    mysql_query("DELETE FROM hospital WHERE id='$id' AND rid='$rid'");
                    }
                    elseif($heal < $hospital[in_bounce])
                    {
                    mysql_query("UPDATE $tab[pimp] SET thugs=thugs+$heal, cash=cash-$afford WHERE id='$id' AND rid='$rid'");
                    mysql_query("UPDATE hospital SET in_bounce=in_bounce-$heal WHERE id='$id' AND rid='$rid'");
                    }
        }
    }


secureheader();
?>

<form method="post" action="hospital.php?rid=<?=$rid?>">
<font size="+1"><b>Hospital</b></font>
<br>
<br><font color="#FFCC00"><?=$msg?></font><br>

<font color="#8F92E8">

</font>
<br>You have <font color="8F92E8"><b><?=commas($hospital[in_bounce])?></font> bouncers</b> injured in the hospital. They will start to die in XXXXXXX time.
</nobr>
<br>
<br>


<table width="80%" border="0">

 <tr>

        <td>

Last edited by Wildhoney : 12-06-2008 at 06:22 PM. Reason: Good call, Tanax
KingOfTheSouth is offline  
Reply With Quote