
Karlos
Members-
Posts
951 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by Karlos
-
Re: FIRST THOUGH! sperm
-
Re: FIRST THOUGH! life
-
Re: [mccode v2] Crystal Temple Sorry but I gave a working code out, however I do not provide support for my source being modified, maybe asking in the mccode/dbscode Game Engine board for help.
-
Re: [mccode v2] Monorail Recode Looks nice... and coded nice. :wink:
-
Re: [mccode v2] Crystal Temple Here's an updated one (With the array();) <?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', 'Donator', 'Protect'))) { 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 sprintf("[url='ctemple.php?spend=WillR']Will Refill - %s Crystals[/url] ", number_format($Config['WillRefill'])); echo printf("[url='ctemple.php?spend=BraveR']Brave Refill - %s Crystals[/url] ", number_format($Config['BraveRefill'])); echo sprintf("[url='ctemple.php?spend=Donator']3 Donator Days - %s Crystals[/url] ", number_format($Config['DonatorDays'])); echo sprintf("[url='ctemple.php?spend=Protect']Protection - %s Crystals (30 Minutes Only)[/url] ", number_format($Config['Protection'])); } 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'] == '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 %d 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 %d 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 %d Crystals For 3 Donator Days.", number_format($Config['DonatorDays'])); } } else if ($_GET['spend'] == 'Protect') { if ($ir['crystals'] < $Config['Protection']) { Error('You Don\'t Have Enough Crystals!'); } else if ($Config['Protection'] != '0') { Error('You Already Have Protection...'); } else { $db->query(sprintf("UPDATE users SET protection=protection+30, crystals=crystals-%d WHERE userid=%d", $Config['Protection'], $userid)); echo sprintf("You Have Paid %d Crystals For 30 Minutes Protection.", number_format($Config['Protection'])); } } } $h->endpage(); ?> Note: Add this to cron_minute.php $db->query("UPDATE `users` SET `protection`=MAX('0', `protection`-'1') WHERE `protection` > '0'"); Addition to your crons is untested.
-
Re: [v2]Ctemple AlabamaHit the reason i have a copy of what he show in the screen shots is because i copied it due to it being such a simple mod and it was made for free.... So hence I made one :roll:
-
Re: mccodes error No problem. :wink:
-
Re: FIRST THOUGH! eggs
-
Re: mccodes error Add this to global_func.php if (!function_exists('stafflog_add')) { function stafflog_add($Text) { global $db, $userid; $db->query(sprintf("INSERT INTO `stafflog` (`user`, `time`, `action`, `ip`) VALUES('%u', unix_timestamp(), '%s', '%s')", $userid, $Text, $_SERVER['REMOTE_ADDR'])); } } Untested.
-
Re: [mccode v2] Crystal Temple Hmm, that is an idea... But to be honest i'm not the best with array(); s. I still am learning where to use them but thanks for the tip POG1 :-)
-
Re: [mccodes]Secure demo account Seems like a better idea in my opinion.. I'd use the first example in my preference, but i'm not gonna use them :-P
-
Re: THIS OR THAT? XP Money or Knowledge
-
Re: [mccode v2] workin cyberbank I don't... Just the way I code nowadays.. I keep developing my coding style and I am currently happy with my current so it's not making it look pretty in my eyes... Just easier to read :wink:
-
Re: [mccode v2] Secure Bank! I got the idea from Anthony and the exit($h->endpage()); idea from Kyle although he used die in his example :-P
-
Re: [mccode v2] workin cyberbank <?php include_once (DIRNAME(__FILE__) . '/globals.php'); echo '<h3 style="text-decoration: underline;">Cyber Bank</h3>'; $OpenPrice = '5000000'; $PercentTakenDep = '20'; // Do Not Add A % Sign! $MaxTakenDep = '300000'; // Start Function - Got This Idea From Anthony.. (Magictallguy) if (!function_exists('Error')) { function Error($Message) { global $h; echo sprintf("<span style='color: #FF0000;'>Error! %s</span>", $Message); $h->endpage(); exit(); } } // End Function - Got This Idea From Anthony.. (Magictallguy) if ($ir['cybermoney'] > '-1') { $_GET['act'] = isset($_GET['act']) && ctype_alpha($_GET['act']) ? trim($_GET['act']) : FALSE; switch ($_GET['act']) { case 'Deposit': Deposit(); break; case 'Withdraw': Withdraw(); break; default: Index(); break; } } else { if (isset($_GET['Buy'])) { if ($ir['money'] >= $OpenPrice) { echo sprintf("Congratulations, you bought a Cyber Bank account for %s gold! ", number_format($OpenPrice)); echo '[url="cyberbank.php"]Start using my account[/url]'; $db->query(sprintf("UPDATE users SET money=money-%d, cybermoney=0 WHERE userid=%d", $OpenPrice, $userid)); } else { echo 'You do not have enough gold to open an account. [url="explore.php"]Back to town...[/url]'; } } else { echo sprintf("Open a Cyber Bank account today, just %s gold! ", number_format($OpenPrice)); echo '[url="cyberbank.php?Buy"]> Yes, sign me up![/url]'; } } function Index() { global $ir, $PercentTakenDep, $MaxTakenDep; echo sprintf("[b]You currently have %s Gold in the Cyber Bank.[/b] ", number_format($ir['cybermoney'])); echo ' <table width="95%" cellspacing="1"> <tr> <td width="50%"> [b]Deposit gold[/b] '; echo sprintf("It Will Cost You %d%% Of The Gold You Deposit (Rounded Up). The Maximum Fee Is %s Gold.", $PercentTakenDep, number_format($MaxTakenDep)); echo '<form action="cyberbank.php?act=Deposit" method="post">'; echo sprintf("Amount: <input type='text' name='deposit' value='%s' /> ", $ir['money']); echo '<input type="submit" value="Deposit" /> </form> </td> <td width="50%"> [b]Withdraw gold[/b] There Is No Fee On Withdrawing Gold! <form action="cyberbank.php?act=Withdraw" method="post">'; echo sprintf("Amount: <input type='text' name='withdraw' value='%s' /> ", $ir['cybermoney']); echo '<input type="submit" value="Withdraw" /> </form> </td> </tr> </table>'; } function Deposit() { global $db, $ir, $userid, $PercentTakenDep, $MaxTakenDep; $_POST['deposit'] = abs((float) $_POST['deposit']); if ($_POST['deposit'] > $ir['money']) { Error('You Don\'t Have Enough Gold To Deposit This Amount.'); } else { $Fee = $_POST['deposit'] * $PercentTakenDep / '100'; $Fee = ($Fee >= $MaxTakenDep) ? $MaxTakenDep : $Fee; $Gain = @intval($_POST['deposit'] - $Fee); $ir['cybermoney'] += $Gain; $db->query(sprintf("UPDATE users SET cybermoney=cybermoney+%u, money=money-%u WHERE userid=%u", $Gain, $_POST['deposit'], $userid)); echo sprintf("You Hand Over %s Gold To Be Deposited, ", number_format($_POST['deposit'])); echo sprintf("After The Fee Is Taken (%s Gold), %s Gold Is Added To Your Account. ", number_format($Fee), number_format($Gain)); echo sprintf("[b]You Now Have %s Gold In The Cyber Bank.[/b] ", number_format($ir['cybermoney'])); echo '> [url="cyberbank.php"]Back[/url]'; } } function Withdraw() { global $db, $ir, $c, $userid; $_POST['withdraw'] = abs((float) $_POST['withdraw']); if ($_POST['withdraw'] > $ir['cybermoney']) { Error('You Don\'t Have Enough Cyber Banked Gold To Withdraw This Amount.'); } else { $Gain = $_POST['withdraw']; $ir['cybermoney'] -= $Gain; $db->query(sprintf("UPDATE users SET cybermoney=cybermoney-%u, money=money+%u WHERE userid=%u", $Gain, $Gain, $userid)); echo sprintf("You Ask To Withdraw %s Gold, ", number_format($Gain)); echo 'The Cyber Banking Lady Grudgingly Hands It Over. '; echo sprintf("[b]You Now Have %s Gold In The Cyber Bank.[/b] ", number_format($ir['cybermoney'])); echo '> [url="cyberbank.php"]Back[/url]'; } } $h->endpage(); ?> You'll have to add withdrawing fees if you want them... Only need one of the following! // With sprintf(); function Error($Message) { global $h; echo sprintf("<span style='color: #FF0000;'>Error! %s</span>", stripslashes($Message)); exit($h->endpage()); } // With printf(); function Error($Message) { global $h; printf("<span style='color: #FF0000;'>Error! %s</span>", stripslashes($Message)); exit($h->endpage()); } //Without sprintf(); or printf(); function Error($Message) { global $h; echo '<span style="color: #FF0000;">Error! '.stripslashes($Message).'</span>'; exit($h->endpage()); }
-
Re: THIS OR THAT? Hmmm... Computer for me :) Bebo or Facebook?
-
Re: THIS OR THAT? Beer.. Master C or Master PHP
-
Re: 3 Word Game And a penis!
-
Re: [ANY] FREE BANNER Duplicate layer.. Flip it.. Lower opactity.. :wink:
-
Re: Think your a good coder? What would you like done to it?
-
Re: Which File Extension are You? Umm.... I'm not sure about that... :lol:
-
Re: 3 Word Game booze, and stick
-
Re: Jail_Reason Well the query he gave, and the Board this is in... I'm guessing MC Codes..
-
Re: Jail_Reason Or... $JailReason = 'Some Reason...'; $db->query(sprintf("UPDATE users SET jail_reason=%s WHERE userid=%d", addslashes($JailReason), $userid));
-
[mccode v2] Crystal Temple Thanks, It just draw's more attention to what should only be modified so the code can work still.