CuddlesBear Posted March 3, 2010 Share Posted March 3, 2010 <?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 Quote Link to comment Share on other sites More sharing options...
wrx Posted March 3, 2010 Share Posted March 3, 2010 remove "{" from that {$h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
CuddlesBear Posted March 3, 2010 Author Share Posted March 3, 2010 Didn't work D: Quote Link to comment Share on other sites More sharing options...
Joshua Posted March 3, 2010 Share Posted March 3, 2010 For one. it's crystal temple not market :P for 2 try turning that last { into an } ;) Quote Link to comment Share on other sites More sharing options...
CuddlesBear Posted March 3, 2010 Author Share Posted March 3, 2010 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: Quote Link to comment Share on other sites More sharing options...
Joshua Posted March 3, 2010 Share Posted March 3, 2010 <?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(); ?> Quote Link to comment Share on other sites More sharing options...
CuddlesBear Posted March 3, 2010 Author Share Posted March 3, 2010 Thanks imortal :D Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted March 3, 2010 Share Posted March 3, 2010 Just a quick tip, maybe you could use this => [jail/hospital] Notifications I use something similar on my CrimGame not many people have looked at it enough to actually get the idea or understand why it would be better but im sure if you added maybe custom notification on there it would seem more obvious. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.