Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

Have you purchased a mod and lost your copy? Just file a support ticket through your "My Mods" page.


This forum is now closed and has moved to a new location! Click here to find out why.
Pages: 1 [2]

AuthorTopic: [MCCode] Crystal Gym  (Read 3496 times)

strats

  • Active Member
  • **
  • Reputation Power: 13
  • strats has no influence.
  • Offline Offline
  • Posts: 109
    • View Profile
Re: [MCCode] Crystal Gym
« Reply #15 on: May 11, 2009, 06:25:52 AM »
Tested it.
Get a problem with an extra =
so I took it out like so it's like this

for($i = 1; $i<  $_GET['crystals'] && $ir['crystals'] > 0; $i++)

It's works but still when I click on to that gym it still gives me an extra index inside my index lol

Take a lookie  :

http://i5.photobucket.com/albums/y175/shady_is_dizzy/Screenie.jpg
Logged

lumpy054

  • Basic Member
  • *
  • Reputation Power: 12
  • lumpy054 has no influence.
  • Offline Offline
  • Posts: 33
    • MSN Messenger - lumpy054@hotmail.com
    • AOL Instant Messenger - lumpy054
    • View Profile
    • WWW
    • Email
Re: [MCCode] Crystal Gym
« Reply #16 on: May 18, 2009, 10:59:12 PM »
LOL Heres My File To Help You:

Code: [Select]
<?php
require "globals.php";
if(
$ir['donatordays'] == 0)
{
die(
"This feature is for donators only, <a href='donator.php'>Click Here to become one!</a>");
}
if(
$ir['jail'] > 0)
{
die(
"<b><font color=red size=+1>You are in Jail for {$ir['jailtime']} more minute(s).<br />
Until you are out you can't train</font></b><br /><br />
<a href='jail.php'>Return to Jail</a>"
);
}
if(
$ir['hospital'] > 0)
{
die(
"<b><font color=red size=+1>You are in the Hospital for {$ir['hosptime']} more minute(s).<br />
Until you are out you can't train</font></b><br /><br />
<a href='hospital.php'>Return to Hospital</a>"
);
}
if(
$_GET['crystals']>10)
{
die(
"You cannot use that many points at one time.<br />
10 points is the most you can use at a single time.
"
);
}
if(isset(
$_GET['train']))
{
$tgain=0;
{
$out="";
for(
$i=1;$i<=$_GET['crystals'] && $ir['crystals'] > 0;$i++)
{
if (
$ir['crystals'] >= $_GET['crystals'])
{
$gain=rand(1,3)/rand(800,1000)*rand(800,1000)*(($ir['will']+20)/150)*($ir['maxenergy']/12);
$tgain+=$gain;
if (
$_GET['train']=="IQ") { $gain/=100; }
$ir[$_GET['train']]+=$gain;
$egain=$gain/10;
$ts=$ir[$_GET['train']];
$st=$_GET['train'];
mysql_query("UPDATE userstats SET $st=$st+".$gain." WHERE userid=$userid",$c) or die("UPDATE userstats SET $st=$st+$gain WHERE userid=$userid<br />".mysql_error());
$wu=(int) (rand(8,12));
mysql_query("UPDATE users SET crystals=crystals-1,exp=exp+$egain,will=will-$wu WHERE userid=$userid",$c);
mysql_query("UPDATE users SET will=0 WHERE will<0",$c);
}
else
{
$out="You do not have that many points.";
}
}
}
$stat=$ir[$st];
$crystals=($ir['crystals']-$_GET['crystals']);
$i--;
$out="You begin training your $st.<br />
You have gained $tgain $st by training it {$_GET['crystals']} times.<br />
You now have $stat $st and $crystals points left.<br /><br />"
;
}
else
{
$out="<h3><center>Point Gym</center></h3>";
}
print 
"<table width=50% border=1 bordercolor='blue'>
<tr><td background='backmain.jpg'>$out</td></tr><tr>
<td  align=center valign=middle background='backmain.jpg'><center>Choose how many points you want to use to train.</br> You currently have <b><font color=yellow>{$ir['crystals']}</font></b> points.</center><br /></td></tr>

<tr><td width=50% align=center valign=middle background='backmain.jpg'>"
;
if ( 
$ir['energy'] > 0) {
print 
"
<form action='cgym.php' method='get'>
Enter the number of points you wish to use: <br>
<input type='text' name='crystals' value='' /><br /><br>
Stat: <br><select type='dropdown' name='train'>
<option value='strength'>Strength</option>
<option value='agility'>Speed</option>
<option value='labour'>Labour</option>
<option value='guard'>Defense</option></select></td></tr>
<tr><td  align=center valign=middle background='backmain.jpg'>
<input type='submit' value='Train Now!' /></form>
<br /><hr /><h3>Stats Info:</h3>"
;
$ts=$ir['strength']+$ir['agility']+$ir['guard']+$ir['labour']+$ir['IQ'];
$arr=urlencode(serialize(array($ir['strength'],$ir['agility'],$ir['guard'],$ir['labour'],$ir['IQ'])));
$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');
$ir['IQrank']=get_rank($ir['IQ'],'IQ');
$tsrank=get_rank($ts,'strength+agility+guard+labour+IQ');
$ir['strength']=number_format($ir['strength']);
$ir['agility']=number_format($ir['agility']);
$ir['guard']=number_format($ir['guard']);
$ir['labour']=number_format($ir['labour']);
$ir['IQ']=number_format($ir['IQ']);
$ts=number_format($ts);

print 
"<table border='2'><tr><td><b>Strength:</b> {$ir['strength']} [Ranked: {$ir['strank']}]</td><td><b>Speed:</b> {$ir['agility']} [Ranked: {$ir['agirank']}]</td></tr>
<tr><td><b>Defense:</b> {$ir['guard']} [Ranked: {$ir['guarank']}]</td><td><b>Labor:</b> {$ir['labour']} [Ranked: {$ir['labrank']}]</td></tr>
<tr><td><b>IQ: </b> {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td><td><b>Total stats:</b> {$ts} [Ranked: $tsrank]</td></tr></table>"
;
} else {
print 
"You do not have any points to train with!";

}
print 
"</td></tr></td></tr></table>";

$h->endpage();
?>
Logged

getty

  • Basic Member
  • *
  • Reputation Power: 2
  • getty has no influence.
  • Offline Offline
  • Posts: 5
    • View Profile
    • Email
Re: [MCCode] Crystal Gym
« Reply #17 on: November 11, 2010, 09:53:08 AM »
LOL Heres My File To Help You:

Code: [Select]
<?php
require "globals.php";
if(
$ir['donatordays'] == 0)
{
die(
"This feature is for donators only, <a href='donator.php'>Click Here to become one!</a>");
}
if(
$ir['jail'] > 0)
{
die(
"<b><font color=red size=+1>You are in Jail for {$ir['jailtime']} more minute(s).<br />
Until you are out you can't train</font></b><br /><br />
<a href='jail.php'>Return to Jail</a>"
);
}
if(
$ir['hospital'] > 0)
{
die(
"<b><font color=red size=+1>You are in the Hospital for {$ir['hosptime']} more minute(s).<br />
Until you are out you can't train</font></b><br /><br />
<a href='hospital.php'>Return to Hospital</a>"
);
}
if(
$_GET['crystals']>10)
{
die(
"You cannot use that many points at one time.<br />
10 points is the most you can use at a single time.
"
);
}
if(isset(
$_GET['train']))
{
$tgain=0;
{
$out="";
for(
$i=1;$i<=$_GET['crystals'] && $ir['crystals'] > 0;$i++)
{
if (
$ir['crystals'] >= $_GET['crystals'])
{
$gain=rand(1,3)/rand(800,1000)*rand(800,1000)*(($ir['will']+20)/150)*($ir['maxenergy']/12);
$tgain+=$gain;
if (
$_GET['train']=="IQ") { $gain/=100; }
$ir[$_GET['train']]+=$gain;
$egain=$gain/10;
$ts=$ir[$_GET['train']];
$st=$_GET['train'];
mysql_query("UPDATE userstats SET $st=$st+".$gain." WHERE userid=$userid",$c) or die("UPDATE userstats SET $st=$st+$gain WHERE userid=$userid<br />".mysql_error());
$wu=(int) (rand(8,12));
mysql_query("UPDATE users SET crystals=crystals-1,exp=exp+$egain,will=will-$wu WHERE userid=$userid",$c);
mysql_query("UPDATE users SET will=0 WHERE will<0",$c);
}
else
{
$out="You do not have that many points.";
}
}
}
$stat=$ir[$st];
$crystals=($ir['crystals']-$_GET['crystals']);
$i--;
$out="You begin training your $st.<br />
You have gained $tgain $st by training it {$_GET['crystals']} times.<br />
You now have $stat $st and $crystals points left.<br /><br />"
;
}
else
{
$out="<h3><center>Point Gym</center></h3>";
}
print 
"<table width=50% border=1 bordercolor='blue'>
<tr><td background='backmain.jpg'>$out</td></tr><tr>
<td  align=center valign=middle background='backmain.jpg'><center>Choose how many points you want to use to train.</br> You currently have <b><font color=yellow>{$ir['crystals']}</font></b> points.</center><br /></td></tr>

<tr><td width=50% align=center valign=middle background='backmain.jpg'>"
;
if ( 
$ir['energy'] > 0) {
print 
"
<form action='cgym.php' method='get'>
Enter the number of points you wish to use: <br>
<input type='text' name='crystals' value='' /><br /><br>
Stat: <br><select type='dropdown' name='train'>
<option value='strength'>Strength</option>
<option value='agility'>Speed</option>
<option value='labour'>Labour</option>
<option value='guard'>Defense</option></select></td></tr>
<tr><td  align=center valign=middle background='backmain.jpg'>
<input type='submit' value='Train Now!' /></form>
<br /><hr /><h3>Stats Info:</h3>"
;
$ts=$ir['strength']+$ir['agility']+$ir['guard']+$ir['labour']+$ir['IQ'];
$arr=urlencode(serialize(array($ir['strength'],$ir['agility'],$ir['guard'],$ir['labour'],$ir['IQ'])));
$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');
$ir['IQrank']=get_rank($ir['IQ'],'IQ');
$tsrank=get_rank($ts,'strength+agility+guard+labour+IQ');
$ir['strength']=number_format($ir['strength']);
$ir['agility']=number_format($ir['agility']);
$ir['guard']=number_format($ir['guard']);
$ir['labour']=number_format($ir['labour']);
$ir['IQ']=number_format($ir['IQ']);
$ts=number_format($ts);

print 
"<table border='2'><tr><td><b>Strength:</b> {$ir['strength']} [Ranked: {$ir['strank']}]</td><td><b>Speed:</b> {$ir['agility']} [Ranked: {$ir['agirank']}]</td></tr>
<tr><td><b>Defense:</b> {$ir['guard']} [Ranked: {$ir['guarank']}]</td><td><b>Labor:</b> {$ir['labour']} [Ranked: {$ir['labrank']}]</td></tr>
<tr><td><b>IQ: </b> {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td><td><b>Total stats:</b> {$ts} [Ranked: $tsrank]</td></tr></table>"
;
} else {
print 
"You do not have any points to train with!";

}
print 
"</td></tr></td></tr></table>";

$h->endpage();
?>

at first i was getting a error message when i clicked crystal gym from link then i used the above code and that problem went away now when i click train it get a this message

Not Found

The requested URL /cgym.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Logged
Pages: 1 [2]
« previous next »
 


This forum is now closed and has moved to a new location! Click here to find out why.