Jump to content
MakeWebGames

Recommended Posts

Posted

One last thing :lol:

i looked at the coding for energy refill

edited it to all nerve refiil

but it just says its full when its not :oops:

please help

Bit basic but here it is lol

What would you like to spend your points on?



[url='crystaltemple.php?spend=refill']Energy Refill - {$set['ct_refillprice']} points[/url]

[url='crystaltemple.php?spend=money']Money - \$".number_format($set['ct_moneypercrys'])." per point[/url]
";
}
else
{
if($_GET['spend'] == 'refill')
{
if($ir['crystals'] <$set['ct_refillprice'])
{
print "You don't have enough points!";
}
else if($ir['energy'] == $ir['maxenergy'])
{
print "You already have full Energy.";
}
else
{
$db->query("UPDATE users SET energy=maxenergy,crystals=crystals-{$set['ct_refillprice']} WHERE userid=$userid");
print "You have paid {$set['ct_refillprice']}points to refill your Energy bar.";
}
}
else if($_GET['spend'] == 'IQ')
{
print "Type in the amount of crystals you want to swap for IQ.

You have [b]{$ir['crystals']}[/b] crystals.

One crystal = {$set['ct_iqpercrys']} IQ.<form action='crystaltemple.php?spend=IQ2' method='post'><input type='text' name='crystals' />
<input type='submit' value='Swap' /></form>";
}
else if($_GET['spend'] == 'IQ2')
{
$_POST['crystals']=(int) $_POST['crystals'];
if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals'])
{
print "Error, you either do not have enough points or did not fill out the form.

[url='crystaltemple.php?spend=IQ']Back[/url]";
}
else
{
$iqgain=$_POST['crystals']*$set['ct_iqpercrys'];
$db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']} WHERE userid=$userid");
$db->query("UPDATE userstats SET IQ=IQ+$iqgain WHERE userid=$userid");
print "You traded {$_POST['crystals']} crystals for $iqgain IQ.";
}
}
else if($_GET['spend'] == 'money')
{
print "Type in the amount of points you want to swap for money.

You have [b]{$ir['crystals']}[/b] points.

One crystal = \$".number_format($set['ct_moneypercrys']).".<form action='crystaltemple.php?spend=money2' method='post'><input type='text' name='crystals' />
<input type='submit' value='Swap' /></form>";
}
else if($_GET['spend'] == 'money2')
{
$_POST['crystals']=(int) $_POST['crystals'];
if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals'])
{
print "Error, you either do not have enough points or did not fill out the form.

[url='crystaltemple.php?spend=money']Back[/url]";
}
else
{
$iqgain=$_POST['crystals']*$set['ct_moneypercrys'];
$db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']},money=money+$iqgain WHERE userid=$userid");
print "You traded {$_POST['crystals']} points for \$".number_format($iqgain).".";
}
}
}
$h->endpage();
?>
Posted

Re: Nerve Refill for crystal temple

yes i know

but i would like one refill for energy and one for nerve

but when i add nerve into it it doesnt work properly

Posted

Re: Nerve Refill for crystal temple

 

What would you like to spend your points on?



[url='crystaltemple.php?spend=brefill']Brave Refill - {$set['ct_refillprice']} points[/url]

[url='crystaltemple.php?spend=refill']Energy Refill - {$set['ct_refillprice']} points[/url]

[url='crystaltemple.php?spend=money']Money - \$".number_format($set['ct_moneypercrys'])." per point[/url]
";
}
else
{
if($_GET['spend'] == 'brefill')
{
if($ir['crystals'] <$set['ct_refillprice'])
{
print "You don't have enough points!";
}
else if($ir['brave'] == $ir['maxbrave'])
{
print "You already have full Brave.";
}
else
{
$db->query("UPDATE users SET brave=maxbrave,crystals=crystals-{$set['ct_refillprice']} WHERE userid=$userid");
print "You have paid {$set['ct_refillprice']}points to refill your Brave bar.";
}
}
else if($_GET['spend'] == 'refill')
{
if($ir['crystals'] <$set['ct_refillprice'])
{
print "You don't have enough points!";
}
else if($ir['energy'] == $ir['maxenergy'])
{
print "You already have full Energy.";
}
else
{
$db->query("UPDATE users SET energy=maxenergy,crystals=crystals-{$set['ct_refillprice']} WHERE userid=$userid");
print "You have paid {$set['ct_refillprice']}points to refill your Energy bar.";
}
}
else if($_GET['spend'] == 'IQ')
{
print "Type in the amount of crystals you want to swap for IQ.

You have [b]{$ir['crystals']}[/b] crystals.

One crystal = {$set['ct_iqpercrys']} IQ.<form action='crystaltemple.php?spend=IQ2' method='post'><input type='text' name='crystals' />
<input type='submit' value='Swap' /></form>";
}
else if($_GET['spend'] == 'IQ2')
{
$_POST['crystals']=(int) $_POST['crystals'];
if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals'])
{
print "Error, you either do not have enough points or did not fill out the form.

[url='crystaltemple.php?spend=IQ']Back[/url]";
}
else
{
$iqgain=$_POST['crystals']*$set['ct_iqpercrys'];
$db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']} WHERE userid=$userid");
$db->query("UPDATE userstats SET IQ=IQ+$iqgain WHERE userid=$userid");
print "You traded {$_POST['crystals']} crystals for $iqgain IQ.";
}
}
else if($_GET['spend'] == 'money')
{
print "Type in the amount of points you want to swap for money.

You have [b]{$ir['crystals']}[/b] points.

One crystal = \$".number_format($set['ct_moneypercrys']).".<form action='crystaltemple.php?spend=money2' method='post'><input type='text' name='crystals' />
<input type='submit' value='Swap' /></form>";
}
else if($_GET['spend'] == 'money2')
{
$_POST['crystals']=(int) $_POST['crystals'];
if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals'])
{
print "Error, you either do not have enough points or did not fill out the form.

[url='crystaltemple.php?spend=money']Back[/url]";
}
else
{
$iqgain=$_POST['crystals']*$set['ct_moneypercrys'];
$db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']},money=money+$iqgain WHERE userid=$userid");
print "You traded {$_POST['crystals']} points for \$".number_format($iqgain).".";
}
}
}
$h->endpage();
?>

 

Something like that?

Posted

Re: Nerve Refill for crystal temple

Sorted now

i missed a "b" from the brave refill

and you missed out a "max" from $ir['maxbrave']) but you editted it in

Thanx :D

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