Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
need help with php page
Old 09-19-2007, 01:32 AM need help with php page
Super Talker

Posts: 121
Trades: 0
i have this page below it is from a mafia game im building but i had to add a few more of the men to it and it seems that it will still only find the original ones that were there witch are thugs and hoes

im thinking that i have to add this
PHP Code:
if($turn_total 0){ $error="You dont have enough turns!"; }
  else{ 
$bugfix=fixed
to each part here
PHP Code:
if ($area == 'casino')
  {
   
$unit1 'whores';
   
$unit2 'card dealers';
    
mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', hoes='$hoe_total+$hoetl, dealers=dealers+$thugtl, protection='$protect', protectstarted='$time' WHERE id='$id'");
  }
 elseif (
$area == 'cafe')
  {
   
$unit1 'hitmen';
   
$unit2 'hustlers';
    
mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', hitmen=hitmen+$hoetl, hustlers=hustlers+$thugtl, protection='$protect', protectstarted='$time' WHERE id='$id' AND rid='$rid'"); 
  }
 elseif (
$area == 'ghetto')
  {
   
$unit1 'bootleggers';
   
$unit2 'punks';
    
mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', bootleggers=bootleggers+$hoetl, punks=punks+$thugtl, protection='$protect', protectstarted='$time' WHERE id='$id' AND rid='$rid'"); 
  }
 elseif (
$area == 'gym')
  {
   
$unit1 'bodyguards';
   
$unit2 'thugs';
    
mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', bodyguards=bodyguards+$hoetl, thug=thug+$thugtl, protection='$protect', protectstarted='$time'  WHERE id='$id' AND rid='$rid'"); 
  }
 else
  {
   echo 
'Please select an area.';
  } 

but im not real sure any ideas would be great thanks much for the help


PHP Code:
<?
include("game_html.php");$game="yes";
mysql_query("UPDATE $tab[pimp] SET currently='scouting for hoes', online='$time' WHERE id='$id' AND rid='$rid'");
$user mysql_fetch_array(mysql_query("SELECT turn,cash,thugs,hoes,medicine,lowrider,bootleggers,bodyguards,hitmen,hustlers,dealers,punks FROM $tab[pimp] WHERE id='$id' AND rid='$rid';"));
if (isset(
$_REQUEST["keyboard"])) $keyboard=$_REQUEST["keyboard"]; else $keyboard="";
if (isset(
$_REQUEST["area"])) $area=$_REQUEST["area"]; else $area="";
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(!
is_numeric($turns) || $turns 0){$error="<br>You didn't enter a (valid)number!";$turns 0;}
    elseif(
$turns>= 2001){$error="<br>you can only use up to 2000 turns!"$turns 0;}
 
    else {
         
srand ((double) microtime() * 1000000);
         
//WHORE SCOUT
         
$scouts=$turns;
         while (
$scouts>0){
                   if(
$scouts 25){
                      
$hoe=round($hoe+(rand(10,25)));$thug=round($thug+(rand(5,10)));
                      
$scouts=($scouts-30);
                     }
               elseif(
$scouts >= 10){
                      
$hoe=round($hoe+(rand(5,10)));$thug=round($thug+(rand(1,5)));
                      
$scouts=($scouts-10);
                     }
               elseif(
$scouts >= 5){
                      
$hoe=round($hoe+(rand(1,5)));$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);
                     }
         }
    
$randevent=rand(0,225);
    
$event="";
    if(
$randevent==0){ $bribe=losecash($id); if($bribe>$user["cash"]){$bribe=$user["cash"];} $bribec=commas($bribe); if($bribe!=0){ $event="FREEZE!!! you are under arrest for prostitution, you bribe the cops with $$bribec."; } }
//    if($randevent==25){ $lowrider=1; $event="You come across a lowrider, and notice the keys are in it..."; }
    
if($randevent==50){ $cash=losecash($id); $cashc=commas($cash); if($cash!=0){ $event="One of your *****es trip over a lump of **** and drops $$cashc!"; } }
    if(
$randevent==75){ $gang=round($user["thugs"]*.05); if($gang>$user["thugs"]){$gang=$user["thugs"];} $gangc=commas($gang); if($gang!=0){ $event="Out of no where, a gang of thugs start shooting at you, $gangc thugs where killed."; } }
//    if($randevent==100){ $event="Congradulations! You have just won $won from they lottery!"; }
    
if($randevent==125){ $gram=round($user["thugs"]*1.5); $gramc=commas($gram); if($gram!=0){ $event="On the way home, you came across $gramc grams of weed!"; } }
    if(
$randevent==150){ $overdose=round($user["hoes"]*.01); if($overdose!=0){ $overdosec=commas($overdose); $event="$overdosec hoes smoked to much cracked and overdosed!"; } }
    if(
$randevent==175){ $medicine=round($user["medicine"]*.10); if($medicine>$user["medicine"]){$medicine=$user["medicine"];}$medicinec=commas($medicine); if($medicine!=0){ $event="10% of your hoes where infected with herpes, your hoes use $medicinec boxs of medicine"; } }
//    if($randevent==225){ $noobbomb=1; $event="While scouting for hoes, you come across a noob bomb???"; }
    
$bonus=(($user["thugs"]/$hoebonus)+1);
    
$hoe=round($hoe*$bonus);
    
$thug=round($thug*$bonus);
  
$hoetl=fixinput($hoes); 
    
$thugtl=fixinput($thugs);
    
$randarea=rand(1,5);
    if(
$randarea==$area){ $bonushoe=round(5*$bonus); $bonusthug=round(2*$bonus); }
    
useresources($turns);
    
$infected=medicine($turns);
    
$killbystd=nomedicine($turns);
    
$cashmade=cash($turns);
    
$thugleft=unhappy("thugs",$turns,$bonus);
    
$hoeleft=unhappy("hoes",$turns,$bonus);
    
$user mysql_fetch_array(mysql_query("SELECT lowrider,hoes,thugs,cash,ak47,weed,turn,medicine,noobbomb,bootleggers,bodyguards,hitmen,hustlers,dealers,punks FROM $tab[pimp] WHERE id='$id' AND rid='$rid';"));
    
$hoe_total fixinput($user["hoes"]+$hoe+$bonushoe-$killbystd-$hoeleft-$overdose); 
    
$thug_total fixinput($user["thugs"]+$thug+$bonusthug-$thugleft-$gang);
    
$cash_total fixinput($user["cash"]+$cashmade-$bribe+$cash);
    
$weed_total fixinput($user["weed"]+$gram);
    
$meds_total fixinput($user["medicine"]-$medicine);
 
    
$turn_total $user["turn"]-$turns;
    if(
$turns >= 60){$protect=60;}else{$protect=$turns;}
    
$noobbomb $user["noobbomb"]+$noobbomb;
    if(
$turn_total 0){ $error="You dont have enough turns!"; }
  else{ 
$bugfix=fixedmysql_query("UPDATE $tab[pimp] SET turn='$turn_total', weed='$weed_total', cash='$cash_total', hoes='$hoe_total+$hoetl', thugs='$thug_total+$thugtl', protection='$protect', protectionstart='$time', medicine='$meds_total', noobbomb='$noobbomb' WHERE id='$id' AND rid='$rid'"); }
if (
$area == 'casino')
  {
   
$unit1 'whores';
   
$unit2 'card dealers';
    
mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', hoes='$hoe_total+$hoetl, dealers=dealers+$thugtl, protection='$protect', protectstarted='$time' WHERE id='$id'");
  }
 elseif (
$area == 'cafe')
  {
   
$unit1 'hitmen';
   
$unit2 'hustlers';
    
mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', hitmen=hitmen+$hoetl, hustlers=hustlers+$thugtl, protection='$protect', protectstarted='$time' WHERE id='$id' AND rid='$rid'"); 
  }
 elseif (
$area == 'ghetto')
  {
   
$unit1 'bootleggers';
   
$unit2 'punks';
    
mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', bootleggers=bootleggers+$hoetl, punks=punks+$thugtl, protection='$protect', protectstarted='$time' WHERE id='$id' AND rid='$rid'"); 
  }
 elseif (
$area == 'gym')
  {
   
$unit1 'bodyguards';
   
$unit2 'thugs';
    
mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', bodyguards=bodyguards+$hoetl, thug=thug+$thugtl, protection='$protect', protectstarted='$time'  WHERE id='$id' AND rid='$rid'"); 
  }
 else
  {
   echo 
'Please select an area.';
  }
    
$worth=worth($id);$wappy=hoehappy($id);$tappy=thughappy($id);
    
mysql_query("UPDATE $tab[pimp] SET hoehappy='$wappy', thughappy='$tappy',worth='$worth', online='$time' WHERE id='$id' AND rid='$rid'");
    }
}
 
$user mysql_fetch_array(mysql_query("SELECT status,hoehappy,thughappy FROM $tab[pimp] WHERE id='$id' AND rid='$rid';"));
secureheader();
?>
<form method="post" action="scout.php?rid=<?=$rid?>">
<font size="+1"><b>scout for hoes</b></font>
<br><b><font color="#B5CDE6">get them *****es out on the corner!</font></b>
<br><font color="#FFCC00"><?=$error?></font><br>
<?if(($keyboard=="enter") && ($bugfix == fixed)){?>
<nobr>
<?if($event){?><br><font color="#B5CDE6"><?=$event?></font><?}?>
<br>using <font color="3366FF"><?=$trn?></font> turns, you found a total of <font color="#3366FF"><?=commas($hoe)?></font> <?= $unit1?> and  found <font color="#3366FF"><?=commas($thug)?></font> <?=$unit2?>
<br>your hoes returned with them <font color="#B5CDE6"><b>$<?=commas($cashmade)?></b></font> in <b>cash</b>
</nobr>
<br>
<br>
<?}?>
<br>use <input type="text" class="text" maxlength="3" size="5" name="turns" value="<?if($turns){echo"$turns";}?>"> turns pimp'n your hoes.</b>
<br>scout around <select name="area">
  <option value="casino" <?PHP if($area == "casino") print("selected");?>>Casino(Whores and Card Dealers)</option>
  <option value="cafe" <?PHP if($area == "cafe") print("selected");?>>Caffe Napoli(Hitmen and Hustlers)</option>
  <option value="ghetto" <?PHP if($area == "ghetto") print("selected");?>>Ghetto(Bootleggers and Punks)</option>
  <option value="gym" <?PHP if($area == "gym") print("selected");?>>Gym(Thugs and Bodyguards)</option>
 </select>
<br>
<br><input type="hidden" name="keyboard" value="enter"><input type="submit" class="submit" name="scout" value="scout">
<br>
<br><small>hoe happiness: <font color="#FFCC00"><?=$user["hoehappy"]?>%</font> &nbsp; thug happiness: <font color="#FFCC00"><?=$user["thughappy"]?>%</font></small>
</form>
<?if(($user["status"] != 1) && ($user["status"] != 2)){?>
<small><font color="#FFCC00">Supporters Only:</font> set default scout turns
<br><a href="credits.php">learn more about becoming a supporter and supporter features</a>
</small>
<?}?>
<br>
<br>
<?=bar()?>
<br>
<?
gamefooter
();
unset(
$user);
?>

Last edited by bikerboys; 09-19-2007 at 01:33 AM..
bikerboys is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-19-2007, 01:25 PM Re: need help with php page
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Put it before

PHP Code:
 elseif ($area == 'gym')
  {
   
$unit1 'bodyguards';
   
$unit2 'thugs';
    
mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', bodyguards=bodyguards+$hoetl, thug=thug+$thugtl, protection='$protect', protectstarted='$time'  WHERE id='$id' AND rid='$rid'"); 
  }
 else 
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Reply     « Reply to need help with php page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23095 seconds with 12 queries