Jump to content
MakeWebGames

Ok, 2 Tiny things shy of a new FULLY functional mod.


Joshua

Recommended Posts

EVERYTHING i've done to my race mod has turned out just like I wanted it.

HOWEVER :|

I cannot no matter what I do (tried this off and on for months) Get my Gym to do what it's supposed to

I need it to give me a multipler for a certain stat for certain races

i.e if you are a vampire, you get more agility per workout

human guard

wolf strength

I DNO WHY i cant get this to work :\

I have an idea it has to do with gain and i'm just doign something wayyy wrong.

<?php
$macropage="gym2.php";
require "globals.php";
if($ir['hospital']) { die("<prb>This page cannot be accessed while in hospital.</prb>"); }
$statnames=array(
'Strength' => 'strength',
'Agility' => 'agility',
'Guard' => 'guard',
'Labour' => 'labour');
$_POST['amnt']=abs((int) $_POST['amnt']);


if(!$ir['jail'])
{
print "<h1>Gym</h1><hr width='90%' align='left' />";
}
else
{
 print "<h1>Jail Gym</h1><hr width='90%' align='left' />";
}
if($_POST['stat'] && $_POST['amnt'])
{
 $stat=$statnames[$_POST['stat']];
 if(!$stat)
 {
   die("<prb>This stat cannot be trained.</prb>");
 }
 if($_POST['amnt'] > $ir['energy'])
 {
   print("<prb>You do not have enough energy to train that much.</prb><hr width='90%' align='left' />");
 }
 else
 {
   $gain=0;
   for($i=0; $i<$_POST['amnt']; $i++)
   {
     $gain+=rand(1,3)/rand(800,1000)*rand(800,1000)*(($ir['will']+20)/150);
     $ir['will']-=rand(1,3);
     if($ir['will'] < 0) { $ir['will']=0; }
   }
   if($ir['jail']) { $gain/=2; }
   $db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid");
   $db->query("UPDATE `users` SET `will` = {$ir['will']}, energy = energy - {$_POST['amnt']} WHERE `userid` = $userid");

if($ir['race'] == 1 AND $stat=="guard")
{
$inc=$ir[$stat]+$gain*5;
$inc2=$ir['energy']-$_POST['amnt'];
}
else if($ir['race'] == 2 AND $stat=="agility")
{
$inc=$ir[$stat]+$gain*20;
$inc2=$ir['energy']-$_POST['amnt'];
}
else if($ir['race'] == 3 AND $stat=="guard")
{
$inc=$ir[$stat]+$gain*5;
$inc2=$ir['energy']-$_POST['amnt'];
}
else
{
$inc=$ir[stat]+$gain*1.1;
$inc2=$ir['energy']-$_POST['amnt'];
}


   if($stat=="strength")
   {
     print "You start to lift some weights, You go heavier and heavier until You are out of energy.

     You have gained {$gain} strength by doing {$_POST['amnt']} sets of weights.

     You now have {$inc} strength and {$inc2} energy left.";
   }
   elseif($stat=="agility")
   {
     print "You Begin to run on the treadmill, You keep tapping the faster button till you fly off the damn thing!.

     You have gained {$gain} agility by doing {$_POST['amnt']} minutes of running.

     You now have {$inc} agility and {$inc2} energy left.";
   }
   elseif($stat=="guard")
   {
     print "You jump into the pool and begin swimming, you keep flapping your arms in the water like Michael Felps, you get a cramp and almost drown.

     You have gained {$gain} guard by doing {$_POST['amnt']} minutes of swimming.

     You now have {$inc} guard and {$inc2} energy left.";
   }
   elseif($stat=="labour")
   {
     print "You walk over to the front desk, and ask the manager If you can volunteer to help the gym out, He says unload the boxes In the back, You unload boxes until the gym closes

     You have gained {$gain} labour by unloading {$_POST['amnt']} boxes.

     You now have {$inc} labour and {$inc2} energy left.";
   }
   print "<hr />";
   $ir['energy']-=$_POST['amnt'];
   $ir[$stat]+=$gain;
 }
}
$ir['strank']=get_rank($ir['strength'],'strength');
$ir['agirank']=get_rank($ir['agility'],'agility');
$ir['guarank']=get_rank($ir['guard'],'guard');
$ir['labrank']=get_rank($ir['labour'],'labour');
print "<table width='90%'><tr><td>

Welcome to the Second Gym!

You can train up to <prb>{$ir['energy']}</prb> times with your
current energy.</p></td></tr></table>
<hr width='90%' align='left' />

<table width='90%' class='table'>
<tr>
  <form action='gym2.php' method='post'>
  <input type='hidden' name='stat' value='Strength'></input>
  <th width='15%'><ph2>Strength:</ph2></th>
  <td width='15%'>{$ir['strength']}</td>
  <td width='10%'>(Rank {$ir['strank']})</td>
  <td width='40%'>Times to train: <input type='text' name='amnt' value='{$ir['energy']}' length='5'></input></td>
  <td width='20%'><input type='submit' value='Go!'></input></td>
  </form>
</tr>
<tr>
  <form action='gym2.php' method='post'>
  <input type='hidden' name='stat' value='Agility'></input>
  <th width='15%'><ph2>Agility:</ph2></th>
  <td width='15%'>{$ir['agility']}</td>
  <td width='10%'>(Rank {$ir['agirank']})</td>
  <td width='40%'>Times to train: <input type='text' name='amnt' value='{$ir['energy']}'></input></td>
  <td width='20%'><input type='submit' value='Go!'></input></td>
  </form>
</tr>
<tr>
  <form action='gym2.php' method='post'>
  <input type='hidden' name='stat' value='Guard'></input>
  <th width='15%'><ph2>Guard:</ph2></th>
  <td width='15%'>{$ir['guard']}</td>
  <td width='10%'>(Rank {$ir['guarank']})</td>
  <td width='40%'>Times to train: <input type='text' name='amnt' value='{$ir['energy']}'></input></td>
  <td width='20%'><input type='submit' value='Go!'></input></td>
  </form>
</tr>
<tr>
  <form action='gym2.php' method='post'>
  <input type='hidden' name='stat' value='Labour'></input>
  <th width='15%'><ph2>Labour:</ph2></th>
  <td width='15%'>{$ir['labour']}</td>
  <td width='10%'>(Rank {$ir['labrank']})</td>
  <td width='40%'>Times to train: <input type='text' name='amnt' value='{$ir['energy']}'></input></td>
  <td width='20%'><input type='submit' value='Go!'></input></td>
  </form>
</tr>
</table>
<hr width='90%' align='left' />

";
$h->endpage();
?>

 

pllz help :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...