Jump to content
MakeWebGames

Recommended Posts

Posted
<?php
include_once (DIRNAME(__FILE__) . '/globals.php');
### Start Configuration ###
$Config = array('EnergyRefill' => '10', 'WillRefill' => '10', 'BraveRefill' => '10', 'DonatorDays' => '10', 'Protection' => '10');
### End Configuration ###
$_GET['spend'] = isset($_GET['spend']) && !empty($_GET['spend']) && ctype_alpha($_GET['spend']) ? $_GET['spend'] : FALSE;
if (!function_exists('Error')) {
function Error($Message) {
 global $h;
 echo sprintf("<span style='color: #FF0000;'>Error!
%s</span>", stripslashes($Message));
 exit($h->endpage());
}
}
if (!in_array($_GET['spend'], array('', 'EnergyR', 'WillR', 'BraveR',))) {
Error('Invalid Command!');
}
if (!$_GET['spend']) {
echo '<span style="text-decoration: underline; font-size: 14px; font-weight: 600">Welcome To The Crystal Temple!</span>

';
echo sprintf("You have [b]%s[/b] crystals.
", number_format($ir['crystals']));
echo 'What would you like to spend your crystals on?
';
echo sprintf("
[url='ctemple.php?spend=EnergyR']Energy Refill - %s Crystals[/url]
", number_format($Config['EnergyRefill'])); 
echo printf("[url='ctemple.php?spend=BraveR']Brave Refill - %s Crystals[/url]
", number_format($Config['BraveRefill'])); 
} else {
if ($_GET['spend'] == 'EnergyR') {
 if ($ir['crystals'] < $Config['EnergyRefill']) {
  Error('You Don\'t Have Enough Crystals!');
 } else if ($ir['energy'] == $ir['maxenergy']) {
  Error('You Already Have Full Energy.');
 } else {
  $db->query(sprintf("UPDATE users SET energy=maxenergy, crystals=crystals-%d WHERE userid=%d", $Config['EnergyRefill'], $userid));
  echo sprintf("You Have Paid %d Crystals To Refill Your Energy Bar.", number_format($Config['EnergyRefill']));
 }
} else if ($_GET['spend'] == 'BraveR') {
 if ($ir['crystals'] < $Config['BraveRefill']) {
  Error('You Don\'t Have Enough Crystals!');
 } else if ($ir['brave'] == $ir['maxbrave']) {
  Error('You Already Have Full Brave.');
 } else {
  $db->query(sprintf("UPDATE users SET brave=maxbrave, crystals=crystals-%d WHERE userid=%d", $Config['BraveRefill'], $userid));
  echo sprintf("You Have Paid %d Crystals To Refill Your Brave Bar.", number_format($Config['BraveRefill']));
  }
{$h->endpage();
?>

 

This is the error I get: syntax error, unexpected $end in /home/deadlyg1/public_html/crystaltemple.php on line 43

Posted
For one.

it's crystal temple not market :P

for 2

try turning that last { into an }

;)

I see this now... That might have worked if I didn't go on an insane rampage and further injure the code D:
Posted
<?php
include_once (DIRNAME(__FILE__) . '/globals.php');
if ($ir['hospital']) 
{ 
  echo "

You cannot access the gym whilst in hospital</p>";
  $h->endpage();
  exit;
}

### Start Configuration ###
$Config = array('EnergyRefill' => '10', 'WillRefill' => '100', 'BraveRefill' => '10', 'DonatorDays' => '200', 'Money' => '10');
### End Configuration ###

$_GET['spend'] = isset($_GET['spend']) && !empty($_GET['spend']) && ctype_alpha($_GET['spend']) ? $_GET['spend'] : FALSE;

if (!function_exists('Error')) {
function Error($Message) {
 global $h;
 echo sprintf("<span style='color: #FF0000;'>Error!
%s</span>", stripslashes($Message));
 exit($h->endpage());
}
}

if (!in_array($_GET['spend'], array('', 'EnergyR', 'WillR', 'BraveR', 'Donator', 'Money'))) 
{
   Error('Invalid Command!');
}

if (!$_GET['spend']) 
{
   echo '<span style="text-decoration: underline; font-size: 14px; font-weight: 600">Welcome To The Point Temple!</span>

';
echo sprintf("You have [b]%s[/b] crystals.
", number_format($ir['crystals']));
         echo 'What would you like to spend your crystals on?
';
echo sprintf("
[url='crystaltemple.php?spend=EnergyR']Energy Refill - %s crystals[/url]
", number_format($Config['EnergyRefill'])); 
echo sprintf("[url='crystaltemple.php?spend=WillR']Will Refill - %s crystals[/url]
", number_format($Config['WillRefill'])); 
echo sprintf("[url='crystaltemple.php?spend=BraveR']Brave Refill - %s crystals[/url]
", number_format($Config['BraveRefill'])); 
 echo sprintf("[url='crystaltemple.php?spend=Donator']3 Donator Days - %s crystals[/url]
", number_format($Config['DonatorDays']));
echo sprintf("[url='crystaltemple.php?spend=Money']1000 money - %s crystals[/url]
", number_format($Config['Money'])); 

} else {
if ($_GET['spend'] == 'EnergyR') {
 if ($ir['crystals'] < $Config['EnergyRefill']) {
  Error('You Don\'t Have Enough crystals!');
 } else if ($ir['energy'] == $ir['maxenergy']) {
  Error('You Already Have Full Energy.');
 } else {
  $db->query(sprintf("UPDATE users SET energy=maxenergy, crystals=crystals-%d WHERE userid=%d", $Config['EnergyRefill'], $userid));
  echo sprintf("You Have Paid %s crystals To Refill Your Energy Bar.", number_format($Config['EnergyRefill']));
 }
} else if ($_GET['spend'] == 'WillR') {
 if ($ir['crystals'] < $Config['WillRefill']) {
  Error('You Don\'t Have Enough crystals!');
 } else if ($ir['will'] == $ir['maxwill']) {
  Error('You Already Have Full Will.');
 } else {
  $db->query(sprintf("UPDATE users SET will=maxwill, crystals=crystals-%d WHERE userid=%d", $Config['WillRefill'], $userid));
  echo sprintf("You Have Paid %s crystals To Refill Your Will Bar.", number_format($Config['WillRefill']));
 }
} else if ($_GET['spend'] == 'BraveR') {
 if ($ir['crystals'] < $Config['BraveRefill']) {
  Error('You Don\'t Have Enough crystals!');
 } else if ($ir['brave'] == $ir['maxbrave']) {
  Error('You Already Have Full Brave.');
 } else {
  $db->query(sprintf("UPDATE users SET brave=maxbrave, crystals=crystals-%d WHERE userid=%d", $Config['BraveRefill'], $userid));
  echo sprintf("You Have Paid %s crystals To Refill Your Brave Bar.", number_format($Config['BraveRefill']));
 }
} else if ($_GET['spend'] == 'Donator') {
 if ($ir['crystals'] < $Config['DonatorDays']) {
  Error('You Don\'t Have Enough crystals!');
 } else if ($ir['donatordays'] != '0') {
  Error('You Already Have Some Donator Days...');
 } else {
  $db->query(sprintf("UPDATE users SET donatordays=donatordays+3, crystals=crystals-%d WHERE userid=%d", $Config['DonatorDays'], $userid));
  echo sprintf("You Have Paid %s crystals For 3 Donator Days.", number_format($Config['DonatorDays']));
 }
}


else if ($_GET['spend'] == 'Money')
{
 if ($ir['crystals'] < $Config['Money'])
{
  Error('You Don\'t Have Enough crystals!');
} 
else
{
  $db->query(sprintf("UPDATE users SET money=money+1000, crystals=crystals-%d WHERE userid=%d", $Config['Money'], $userid));
  echo sprintf("You Have Paid %s crystals For 5000 money.", number_format($Config['Money']));
 }
}


}
$h->endpage();
?>

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