Jump to content
MakeWebGames

Karlos

Members
  • Posts

    951
  • Joined

  • Last visited

    Never

Everything posted by Karlos

  1. Re: [mccode v1] Chests   <?php $file_exist = "config2.php"; if(file_exists($file_exist)) { include("globals.php"); } else if(!file_exists($file_exist)) { session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea();   This Mod Is Labeled V1? Surly Its For Both Versions
  2. Re: [mccodes v2] Main Announcement at the top of the all pages You Told Me Idea... :-) You Started Making It :-P I Made It First :-D You Posted It Here 8-)
  3. Re: [mcv2] Mail Staff From Staff Online List (if you can see the staff online menu) Simple :P
  4. Re: [mcv2] Mail Staff From Staff Online List (if you can see the staff online menu) Karlos Needs To Read
  5. Re: New Host needed Urgently could try... www.globalhostingz.com it is iamwicked so you could ask him for more info
  6. Re: [mccode] Mcc Christmas Theme  
  7. Re: [mccode v2] SafeHouse what dont work?
  8. Re: [mccode v2] Ruby Bank Not Really Excelling....... Heres A Secured Ruby Bank [V2]... <?php /* Ruby Bank Learn To Secure Your Script! Fixed Up By Karlos */ include (DIRNAME(__FILE__) . "/globals.php"); echo "<h3>Ruby Bank</h3>"; if($ir['rubybank']>-1) { $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : ""; switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money'] > 24999) { echo "Congratulations, you bought a Ruby bank account for \$25,000! [url='rubybank.php']Start using my account[/url]"; $sql = sprintf("UPDATE users SET money = money - %u, rubybank = %u WHERE (userid = %u)", 25000, 0, $userid); $db->query($sql); } else { die("You do not have enough money to open an account, it costs \$25,000 for an account [url='explore.php']Back to town...[/url]"); } } else { echo "Open a Ruby bank account today, just \$25,000! [url='rubybank.php?buy']> Yes, sign me up![/url]"; } } function index() { global $db, $ir, $c, $userid, $h; $s = ($_POST['deposit'] == 1) ? "" : "s"; echo sprintf("[b]You currently have %s ruby%s in your ruby bank.[/b] ", number_format($ir['rubybank']), $s); echo ("<table width='85%' cellspacing=1 class='table'>"); echo ("<tr>"); echo ("<td width='50%'>[b]Deposit rubys[/b] "); echo ("<form action='rubybank.php?action=deposit' method='post'>"); echo sprintf("Amount: <input type='text' name='deposit' value='%u' /> ", $ir['rubys']); echo ("<input type='submit' value='Deposit' /></form></td>"); echo ("<td width='50%'>[b]Withdraw rubys[/b] "); echo ("There is no fee on withdrawals.<form action='rubybank.php?action=withdraw' method='post'>"); echo sprintf("Amount: <input type='text' name='withdraw' value='%u' /> ", $ir['rubybank']); echo ("<input type='submit' value='Withdraw' /></form></td>"); echo ("</tr>"); echo ("</table>"); } function deposit() { global $db, $ir, $c, $userid, $h; $_POST['deposit'] = (float) $_POST['deposit']; if($_POST['deposit'] > $ir['rubys']) { echo "You do not have enough rubys to deposit in the bank."; } else { $gain=$_POST['deposit']-$fee; $ir['rubys']+=$gain; $sql = sprintf("UPDATE users SET rubybank = rubybank + %u, rubys = rubys - %u WHERE (userid = %u)", mysql_real_escape_string($gain), mysql_real_escape_string($_POST['deposit']), $userid); $db->query($sql); $s = ($_POST['deposit'] == 1) ? "" : "s"; echo sprintf("You hand over %s ruby%s to be deposited, ", number_format($_POST['deposit']), $s); echo sprintf(" is added to your account. ", number_format($gain)); echo sprintf("[b]You now have %s ruby%s in the bank.[/b] ", number_format($ir['rubybank']), $s); echo ("[url='rubybank.php']> Back[/url]"); } } function withdraw() { global $db,$ir,$c,$userid,$h; $_POST['withdraw'] = (float) $_POST['withdraw']; if($_POST['withdraw'] > $ir['rubybank']) { echo "You do not have enough rubys to withdraw from the bank."; } else { $gain=$_POST['withdraw']; $ir['rubybank']-=$gain; $sql = sprintf("UPDATE users SET rubybank = rubybank - %u, rubys = rubys + %u WHERE (userid = %u)", mysql_real_escape_string($gain), mysql_real_escape_string($gain), $userid); $db->query($sql); $s = ($_POST['deposit'] == 1) ? "" : "s"; echo ("You ask to withdraw \, ", number_format($gain), $s); echo ("the banking lady grudgingly hands it over. "); echo ("[b]You now have %s ruby%s in the bank.[/b] ", number_format($ir['rubybank']), $s); echo ("[url='rubybank.php']> Back[/url]"); } } $h->endpage(); ?>
  9. Re: [Free] [V1] Random Explore Mod   <?php inculde "globals.php"; if(!$ir['hospital'] && $ir['prison']=="0") { if ($answer=="no" || $answer=="") { $answer=stripslashes($_POST['answer']); print "<form action='explorecity.php' method='POST'> Do you wanna explore the deep city? [i](It will cost 8 energy)[/i] <select name='answer'> <option value='yes'>Yes</option> <option value='no'>No</option> </select> <input type='submit' value='Explore!'> </form>"; print " In the city you may find varios things, Beware...."; } if ($answer =="yes") { print "<font size=3> You Explore the deep city.... </font>"; $currentmoney=$ir['money']; $currentenergy=$ir['energy']; $what=rand(1,14); $rand=rand(1,7); $randd=rand(1,7); $crand=rand(2,10); $moneyfound=$rand*$randd; $new=$currentmoney+$moneyfound; $energy=$currentenergy-1; $super=rand(1,1000); $smoney=$moneyfound*$rand+$super+$super+$super; $crystalz=$crand/2; if ($currentenergy<="0") { print "You do not have enough energy to explore"; exit; } if ($what=="1"||"6"||"7"||"8"||"9") { if ($super=="1") { print "You search the deep city finding $$smoney"; $db->query("UPDATE users SET money=$smoney WHERE userid=$userid", $c); $db->query("UPDATE users SET energy=$energy WHERE userid=$userid", $c); exit; } print "You search the deep city finding $$moneyfound.."; $db->query("UPDATE users SET money=$new WHERE userid=$userid", $c); $db->query("UPDATE users SET energy=$energy WHERE userid=$userid", $c); exit; } if ($what=="2"||"3"||"4"||"5") { print "You found $crystalz in a small hole!"; $db->query("UPDATE users SET crystals=crystals+$crystalz WHERE userid=$userid", $c); $db->query("UPDATE users SET energy=$energy WHERE userid=$userid", $c); exit; } if ($what=="10") { print "You fall into a hole"; event_add($userid, "Several hours later you were pulled out of the whole and sent to hospital", $c); $db->query("UPDATE users SET hospital='30' WHERE userid=$userid", $c); $db->query("UPDATE users SET HP='1' WHERE userid=$userid", $c); $db->query("UPDATE users SET hospreadon='Fell into a hole' WHERE userid=$userid", $c); exit; } if ($what=="11") { print "You look round the city but find nothing"; $db->query("UPDATE users SET energy=$energy WHERE userid=$userid", $c); exit; } if ($what=="12") { print "While walking around a witch doctor kindly agress to give you some power!"; $db->query("UPDATE users SET energy=energy+(maxenergy/(12.5)) WHERE energy<maxenergy AND donatordays=0 AND userid=$userid", $c); $db->query("UPDATE users SET energy=energy+(maxenergy/(6)) WHERE energy<maxenergy AND donatordays>0 AND userid=$userid", $c); $db->query("UPDATE users SET energy=maxenergy WHERE energy>maxenergy AND userid=$userid", $c); exit; } if ($what=="13") { print "Exploring this dark bart of this jungle suddenly gave you more bottle!"; $db->query("UPDATE users SET energy=$energy WHERE userid=$userid", $c); $db->query("UPDATE users SET brave=brave+((maxbrave/10)+0.5) WHERE brave<maxbrave AND userid=$userid", $c); $db->query("UPDATE users SET brave=maxbrave WHERE brave>maxbrave AND userid=$userid", $c); exit; } if ($what=="14") { print "Exploring the city you find several pretty flowers, Making your will rise!"; $db->query("UPDATE users SET will=will+10 WHERE will<maxwill AND userid=$userid", $c); $db->query("UPDATE users SET will=maxwill WHERE will>maxwill AND userid=$userid", $c); } } } else { print "You cannot explore while in hosp / prison"; exit; } $h->endpage(); ?>   You don't need session start()
  10. Re: [mccodes V.2]Energy Sweet Shop XD lol missied that out XD
  11. Re: [mccodes v2] Tournement PvP [$10.00]   Stop complaining and make it then. Gezz Chill Out Man
  12. Re: [mccodes V.2]Energy Sweet Shop   Wtf?? $db-> Surely $db->query
  13. Re: [mccodes V.2]Energy Sweet Shop Lol. Fixed...I Was Editing My Bar23 Script To Sort Out The sprinf() :wink:
  14. Re: [mccodes V.2]Energy Sweet Shop Try This Instead <?php /* Energysweetshop V.2 A product of Lost-Warzone [url]http://www.lost-warzone.net[/url] energysweetshop.php Free Mod not to be sold and please keep this part Fixed By Karlos */ include "globals.php"; if(!$_GET['spend']) { echo ' <h2>Energy Sweet Store</h2> [i]Walking in to the Energy Sweet Shop, you decide whether or not to buy a Energy Sweet <table width="70%" border="1" cellspacing="1"> <tr> <th height=8%>Energy Sweet</th> <th height=8%>Cost</th> </tr> <tr> <td>Energy Sweet Shop</td> <td>$10 [url="?spend=1"]Buy Energy Sweet[/url]</td> </tr> </table>'; } else if($_GET['spend'] == 1) { if($ir['money'] < 9) { echo 'You don\'t have enough money to buy the energy sweet'; } else { $sql = sprintf("UPDATE users SET money=money-%u, energy=energy+%u WHERE userid=%s", 10, 5, $userid); mysql_query($sql); echo 'You Bought A energy sweet And You Feel Some of your will coming to you after you ate it! [url="energysweetshop.php.php"]Back to Shop[/url] '; } } $h->endpage(); ?>   More Legible... Better Coding... Nice Attempt Tho...
  15. Re: [Mccodes v2] Tournement PvP Not Being Mean...Seems Easy To Make :|
  16. Re: [mccode v2] Mine Shaft Sorted It Now :D
  17. Re: [mccode v2] Mine Shaft   if($ir['level'] < $_POST['shaft']) // checks to see if the user has the right level { echo 'Invalid Command. You don\'t have the right level for this shaft. >[url="'.$_SERVER['PHP_SELF'].'"]Go Back[/url]'; $h->endpage(); exit; } it works mate Seriously I Put It On My Game Where They Are All Level 1/2 And They Can Do The Level 100 :|
  18. Re: [mccode v2] Add images when you attack   Much Better :-P
  19. Re: [mccode v2] Mine Shaft The level restrictions dont work....
  20. Re: [mccode] Game Ranks   you put it where you want it :lol:
  21. Re: [mccode v2] Add images when you attack or even better use their display pic :|
  22. Re: [mccode v2] Secure Bank! what was the errors? + who seriously would have that much? Also it works perfect on my game Fatal error: Call to undefined function withdraw() in /home/armywar/public_html/bank.php on line 19 that is the error Try This Then <?php include (DIRNAME(__FILE__) . "/globals.php"); print "<h3>Bank</h3>"; if($ir['bankmoney']>-1) { $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : ""; switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money']>4999) { print "Congratulations, you bought a bank account for \$5,000! [url='bank.php']Start using my account[/url]"; $sql = sprintf("UPDATE users SET money = money - %u, bankmoney = bankmoney = %u WHERE (userid = %u)", 5000, 0, $userid); $db->query($sql); } else { print "You do not have enough money to open an account. [url='explore.php']Back to town...[/url]"; } } else { print "Open a bank account today, just \$5,000! [url='bank.php?buy']> Yes, sign me up![/url]"; } } function index() { global $db, $ir, $c, $userid, $h; echo sprintf("[b]You currently have \$%s in the bank.[/b] ", number_format($ir['bankmoney'])); echo ("<table width='85%' cellspacing=1 class='table'>"); echo ("<tr>"); echo ("<td width='50%'>[b]Deposit money[/b] "); echo ("It will cost you 15% of the money you deposit, rounded up. The maximum fee is \$3,000.<form action='bank.php?action=deposit' method='post'>"); echo sprintf("Amount: <input type='text' name='deposit' value='%s' /> ", $ir['money']); echo ("<input type='submit' value='Deposit' /></form></td>"); echo ("<td width='50%'>[b]Withdraw money[/b] "); echo ("There is no fee on withdrawals.<form action='bank.php?action=withdraw' method='post'>"); echo sprintf("Amount: <input type='text' name='withdraw' value='%s' /> ", $ir['bankmoney']); echo ("<input type='submit' value='Withdraw' /></form></td>"); echo ("</tr>"); echo ("</table>"); } function deposit() { global $db,$ir,$c,$userid,$h; $_POST['deposit'] = (float) $_POST['deposit']; if($_POST['deposit'] > $ir['money']) { print "You do not have enough money to deposit this amount."; } else { $fee=ceil($_POST['deposit']*15/100); if($fee > 3000) { $fee=3000; } $gain=$_POST['deposit']-$fee; $ir['money']+=$gain; $sql = sprintf("UPDATE users SET bankmoney = bankmoney + %u, money = money - %u WHERE (userid = %u)", @intval($gain), $_POST['deposit'], $userid); $db->query($sql); echo sprintf("You hand over \$%s to be deposited, after the fee is taken (\$%s), \$%s is added to your account. [b]You now have \$%s in the bank.[/b] [url='bank.php']> Back[/url]", number_format($_POST['deposit']), number_format($fee), number_format($gain), number_format($ir['bankmoney'])); } } function withdraw() { global $db,$ir,$c,$userid,$h; $_POST['withdraw'] = (float) $_POST['withdraw']; if($_POST['withdraw'] > $ir['bankmoney']) { print "You do not have enough banked money to withdraw this amount."; } else { $_POST['withdraw'] = (float) $_POST['withdraw']; $gain=$_POST['withdraw']; $ir['bankmoney']-=$gain; $sql = sprintf("UPDATE users SET bankmoney = bankmoney - %u, money = money + %u WHERE (userid = %u)", $gain, $gain, $userid); $db->query($sql); echo sprintf("You ask to withdraw %s, the banking lady grudgingly hands it over. [b]You now have \$%s in the bank.[/b] [url='bank.php']> Back[/url]", number_format($gain), number_format($ir['bankmoney'])); } } $h->endpage(); ?> Works Perfect For Me :wink: Thanks :-D Thanks Mate :) Do We? :lol:
  23. Re: [mccode v2] Secure Bank!   That +1 means ALOT to mean coming from a good coder unlike myself but im still learning
  24. Re: [mccode v2] Secure Bank! what was the errors? + who seriously would have that much? Also it works perfect on my game
  25. Re: [mccode v2] Secure Bank! thanks :) im not great with securing but i need to learn somewhere
×
×
  • Create New...