Jump to content
MakeWebGames

yaz123

Members
  • Posts

    68
  • Joined

  • Last visited

Everything posted by yaz123

  1. Re: I need help with a Mod i made     $sql = sprintf("UPDATE users SET turns = turns - 1 WHERE (userid = %u)", $userid); $db->query($sql); That should work :)
  2. Re: Attack Script made by us one that works Hopefully. I'll be in (still a noob) but can do some stuff message me via msn - [email protected]
  3. yaz123

    Help

    Warning: Cannot modify header information - headers already sent by (output started at /home/wwwbloo/public_html/test/config.php:11) in /home/wwwbloo/public_html/test/authenticate.php on line 53 authenticate.php <?php session_start(); if(get_magic_quotes_gpc() == 0) { die("Fatal error: MCCode cannot function without MagicQuotes GPC being turned on in PHP.INI."); } include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } if ($_POST['username'] == "" || $_POST['password'] == "") { die("<h3>{$set['game_name']} Error</h3> You did not fill in the login form! <a href=login.php>> Back</a>"); } $uq=$db->query("SELECT userid FROM users WHERE login_name='{$_POST['username']}' AND `userpass`=md5('{$_POST['password']}')"); if ($db->num_rows($uq)==0) { die("<h3>{$set['game_name']} Error</h3> Invalid username or password! <a href=login.php>> Back</a>"); } else { $_SESSION['loggedin']=1; $mem=$db->fetch_row($uq); $_SESSION['userid']=$mem['userid']; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $db->query("UPDATE users SET lastip_login='$IP',last_login=unix_timestamp() WHERE userid={$mem['userid']}"); if($set['validate_period'] == "login" && $set['validate_on']) { $db->query("UPDATE users SET verified=0 WHERE userid={$mem['userid']}"); } header("Location: loggedin.php"); } ?>
  4. Re: [mccode] BLIP Tables (Blocked IPv4 Addresses by CIDR) errrrm - Isn't this like the Cpanel Ip Deny Manager?
  5. Re: Signature Change That I Can Put On Main Menu     <?php include (DIRNAME(__FILE__) ."/globals.php"); switch($_GET['action']) { case 'signaturechange': signature_change(); break; case 'forumchange2': do_forum_change(); break; default: signature_change(); break; } function make_safe($variable) { $variable = mysql_real_escape_string($variable); $variable = htmlspecialchars($variable); return $variable; } function prefs_home() { global $db,$ir,$c,$userid,$h; print "<h3>Preferences</h3> [url='preferences.php?action=signaturechange']Profile Signature Change[/url] "; } function signature_change() { global $ir,$c,$userid,$h; print "<h3>Profile Signature Change</h3> <form action='sigchange.php?action=signaturechange2' method='post'> New Profile Signature: "; echo sprintf("<textarea rows=30 cols=90 name='newsignature' wrap='virtual' class='input'>%s</textarea> ", make_safe($ir['profileSIG'])); print"<input type='submit' value='Change Signature' /></form> [size="1"] > [/size][url='sigchange.php']Back[/url]"; } function do_signature_change() { global $db,$ir,$c,$userid,$h; if($_POST['newsignature'] == "") { print "You did not enter a new profile signature. [size="1"]> [/size][url='sigchange.php?action=signaturechange']Back[/url]"; } else { $sql = sprintf("UPDATE users SET profileSIG='%s' WHERE (userid = %u)", make_safe($_POST['newsignature'])); print "Profile Signature changed! [size="1"]> [/size][url='sigchange.php']Back[/url]"; } } $h->endpage(); ?>
  6. Re: Signature Change That I Can Put On Main Menu   This should work - Not Tested! <?php include (DIRNAME(__FILE__) ."/globals.php"); switch($_GET['action']) { case 'signaturechange': signature_change(); break; case 'forumchange2': do_forum_change(); break; default: signature_change(); break; } function make_safe($variable) { $variable = mysql_real_escape_string(trim($variable)); return $variable; } function prefs_home() { global $db,$ir,$c,$userid,$h; print "<h3>Preferences</h3> [url='preferences.php?action=signaturechange']Profile Signature Change[/url] "; } function signature_change() { global $ir,$c,$userid,$h; print "<h3>Profile Signature Change</h3> <form action='sigchange.php?action=signaturechange2' method='post'> New Profile Signature: "; echo sprintf("<textarea rows=30 cols=90 name='newsignature' wrap='virtual' class='input'>%s</textarea> ", make_safe($ir['profileSIG'])); print"<input type='submit' value='Change Signature' /></form> [size="1"] > [/size][url='sigchange.php']Back[/url]"; } function do_signature_change() { global $db,$ir,$c,$userid,$h; if($_POST['newsignature'] == "") { print "You did not enter a new profile signature. [size="1"]> [/size][url='sigchange.php?action=signaturechange']Back[/url]"; } else { $sql = sprintf("UPDATE users SET profileSIG='%s' WHERE (userid = %u)", make_safe($_POST['newsignature'])); print "Profile Signature changed! [size="1"]> [/size][url='sigchange.php']Back[/url]"; } $h->endpage(); ?>
  7. Re: upload pictures for items php [v2] What the hell is this?
  8. Re: [mccode v2] Fishing Mod   <?php require "globals.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); switch($_GET['action']) { case 'fish': fish_1(); break; case 'fishsub': fish_1_sub(); break; default: fish_index(); break; } /** ** Calls the cases so fish.php?fish **/ function fish_index() { global $ir,$c,$userid; print "<center>Welcome to the Lost City fishing docks. </center>"; Print "<center> You Get 10 Fish Hooks a day dont waste them </center>"; print "<center> <u>Grab a boat and go Fishing!</u> [[url='fish.php?action=fish']Go Fishing[/url]] </center>"; } /** ** This is the main part you see when you come into the php page **/ if ($ir['jailtime'] > 0){ print "<center>The docks are closed to jail birds come back when thay release you</center>"; exit; } if ($ir['hospital'] > 0){ print "<center>You cant go fishing while in hospital</center>"; exit; } /** ** That makes sure you are not in jail or hospital **/ function fish_1() { global $ir,$c,$userid; if($ir['fishing_aloud'] < 1){ print "You have {$ir['fishing_aloud']} fishing times left"; exit; } mysql_query("UPDATE users SET fishing_aloud=fishing_aloud-1 WHERE userid=$userid",$c); $rand_fish = rand(1,5000); $rand_money = rand(10,1000); $rand_exp = rand(1,100); $rand_crystals = rand(1,10); echo "<center>You begin fishing and found $rand_fish fish, you took them to the fish market and sold them for $rand_money money, $rand_crystals Crystals, and gained $rand_exp exp</center> You Currently can fish {$ir['fishing_aloud']} more times"; mysql_query("UPDATE users SET money=money+'$rand_money',exp=exp+'$rand_exp' WHERE userid=$userid",$c); print "<center> [[url='fish.php?action=fish']Fish again[/url]]</center> "; print "<center>[[url='fish.php']Back[/url]]</center> "; } /** ** This is all the stuff that makes the script/mod work ** You shouldnt need to change it enless you want to ** make something add or have different MYSQL Tables **/ ?>   Secure - Not tested, Post any problems!   <?php require "globals.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); switch($_GET['action']) { case 'fish': fish_1(); break; case 'fishsub': fish_1_sub(); break; default: fish_index(); break; } /** ** Calls the cases so fish.php?fish **/ function fish_index() { global $ir,$c,$userid; print "<center>Welcome to the Lost City fishing docks. </center>"; Print "<center> You Get 10 Fish Hooks a day dont waste them </center>"; print "<center> <u>Grab a boat and go Fishing!</u> [[url='fish.php?action=fish']Go Fishing[/url]] </center>"; } /** ** This is the main part you see when you come into the php page **/ if ($ir['jailtime'] > 0){ print "<center>The docks are closed to jail birds come back when thay release you</center>"; exit; } if ($ir['hospital'] > 0){ print "<center>You cant go fishing while in hospital</center>"; exit; } /** ** That makes sure you are not in jail or hospital **/ function fish_1() { global $ir,$c,$userid; if($ir['fishing_aloud'] < 1){ print "You have"; echo sprintf("%u", number_format($ir['fishing_aloud'])); print"fishing times left"; exit; } $sql1 = sprintf("UPDATE users SET fishing_aloud=fishing_aloud-%u WHERE (userid = %u)", 1, $userid); $db->query($sql1) $rand_fish = rand(1,5000); $rand_money = rand(10,1000); $rand_exp = rand(1,100); $rand_crystals = rand(1,10); echo "<center>You begin fishing and found $rand_fish fish, you took them to the fish market and sold them for $rand_money money, $rand_crystals Crystals, and gained $rand_exp exp</center> You Currently can fish"; echo sprintf("%u", number_format($ir['fishing_aloud'])); echo"more times"; $rand = sprintf("UPDATE users SET money = money + '%u', exp = exp + %u WHERE (userid = %u)", $randmoney, $rand_exp); $db->query($rand); print "<center> [[url='fish.php?action=fish']Fish again[/url]]</center> "; print "<center>[[url='fish.php']Back[/url]]</center> "; } /** ** This is all the stuff that makes the script/mod work ** You shouldnt need to change it enless you want to ** make something add or have different MYSQL Tables **/ ?>
  9. Re: Businesses Mod [Mccode V2] :D Nice :)!
  10. Re: [V2]Updated Header[V2] This should work :D <?php class headers { function startheaders() { $key = substr($key = basename($_SERVER['PHP_SELF']), 0, strpos($key, ".")); $page = isset($table[$key]) ? $table[$key] : " "; global $ir, $set; echo <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>{$set['game_name']}</title> <link rel="shortcut icon" href="icon.png"> <style type="text/css"> <!-- body { margin: 0; padding: 0; background: #000000; font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: silver; } h1, h2, h3 { margin-top: 0; } a { text-decoration: none; color: red; } a:hover { color: blue; ---> </style></head> <body> <center> <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center"> EOF; } function userdata($ir,$lv,$fm,$cm,$dosessh=1) { global $db,$c,$userid, $set; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $db->query("UPDATE users SET laston=unix_timestamp(),lastip='$IP' WHERE userid=$userid"); if(!$ir['email']) { global $domain; die ("<body>Your Account May Be Broken. Please Contact Your E-Mail Stating Your Username And User ID."); exit; } if($dosessh && ($_SESSION['attacking'] || $ir['attacking'])) { print "You Lost All Your EXP For Running From A Fight Like A Coward."; $db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid"); $_SESSION['attacking']=0; } $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); $wiperc=(int) ($ir['will']/$ir['maxwill']*100); $experc=(int) ( $ir['exp']/$ir['exp_needed']*100); $brperc=(int) ($ir['brave']/$ir['maxbrave']*100); $hpperc=(int) ($ir['hp']/$ir['maxhp']*100); $enopp=100-$enperc; $wiopp=100-$wiperc; $exopp=100-$experc; $bropp=100-$brperc; $hpopp=100-$hpperc; $d=""; $stmr=""; $u=$ir['username']; if($ir['user_level'] > 1) { $stmr="[img=staffimage here]"; }; if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d="[img=donator.gif]"; } $gn=""; global $staffpage; $bgcolor = ''; print <<<OUT <center> <table border='1' width='100%' bordercolor='red' align='right'> <tr> <td> [img=title.jpg] </center> </td></tr></table><title>{$set['game_name']}</title> </center> <table border='1.0' width='100%' bordercolor='red' align='right'> <th>[b]Energy:[/b] {$enperc}%</th> <th>[b]Will:[/b] {$wiperc}%</th> <th>[b]Brave:[/b] {$ir['brave']}/{$ir['maxbrave']}</th> <th>[b]Respect: {$experc}%</th> <th>[b]Health</font>[/b] {$hpperc}%</th> </tr> <td><img src=ZBar.png width=$enperc height=10><img src=ZBar2.png width=$enopp height=10></td> <td><img src=ZBar.png width=$wiperc height=10><img src=ZBar2.png width=$wiopp height=10></td> <td><img src=ZBar.png width=$brperc height=10><img src=ZBar2.png width=$bropp height=10></td> <td><img src=ZBar.png width=$experc height=10><img src=ZBar2.png width=$exopp height=10></td> <td><img src=ZBar.png width=$hpperc height=10><img src=ZBar2.png width=$hpopp height=10> </td> </tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20%" bgcolor="#$bgcolor" valign="top"> <fieldset> [b]Welcome to <font color='red'>Dark City</font> </fieldset> <fieldset> <font color=silver>[i]<pre> [b]Name:[/b] $gn{$u} [{$ir['userid']}] $d [b]Money:[/b] {$fm} [b]Level:[/b] {$ir['level']} [b]Crystals:[/b] {$ir['crystals']} [[url='logout.php']Quick Logout[/url]] </font>[/i]</pre></fieldset> OUT; if($ir['fedjail']) { $q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid"); $r=$db->fetch_row($q); die("[b]<hr /><font color=red size=+1>You Have Been Dragged Off To {$set['game_name']} Federal Prision For {$r['fed_days']} Day(s).<hr /> Reason: {$r['fed_reason']}</font>[/b]</body></html>"); } if(file_exists('ipbans/'.$IP)) { die("[b]<font color=red size=+1><hr />Your IP Has Been Banned From {$set['game_name']}, There Is No Way Around This.<hr /></font>[/b]</body></html>"); } } function menuarea() { include "mainmenu.php"; global $ir,$c; $bgcolor = ''; print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"> </td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top"> <center>'; if($ir['hospital']) { print "[b]<hr />You Are In The Hospital The Doctors Think You Should Rest Abit For {$ir['hospital']} Minutes.<hr /> "; } if($ir['jail']) { print "[b]<hr />You Have Been Arrested And Hauled Off To The Local Jail {$ir['jail']} Minutes.<hr /> "; } print " <fieldset> [url='donator.php'][b]<pre>[i]<blink>Become A Donator To {$set['game_name']} Now For Extreme Featurez And Benefits!!</blink></pre>[/i][/b][/url]"; print "[url='vote.php'][b]<pre>[i]<blink>Vote For {$set['game_name']}!!</blink></pre>[/i][/b]</fieldset>[/url] "; } function smenuarea() { include "smenu.php"; global $ir,$c; $bgcolor = ''; print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"> </td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top"><center>'; } function endpage() { global $db; print <<<OUT </center> </td> </tr> </table></td> <td class="rgrad"></td> </tr> <tr> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl"> </td> <td class="dgrad"> </td> <td class="dgradr"> </td> </tr> </table> </td> </tr> </table> "Put Your Copyright" </body> </html> OUT; } } ?> If not <?php class headers { function startheaders() { $key = substr($key = basename($_SERVER['PHP_SELF']), 0, strpos($key, ".")); $page = isset($table[$key]) ? $table[$key] : " "; global $ir, $set; echo <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>{$set['game_name']}</title> <link rel="shortcut icon" href="icon.png"> <style type="text/css"> <!-- body { margin: 0; padding: 0; background: #000000; font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: silver; } h1, h2, h3 { margin-top: 0; } a { text-decoration: none; color: red; } a:hover { color: blue; ---> </style></head> <body> <center> <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center"> EOF; } function userdata($ir,$lv,$fm,$cm,$dosessh=1) { global $db,$c,$userid, $set; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $db->query("UPDATE users SET laston=unix_timestamp(),lastip='$IP' WHERE userid=$userid"); if(!$ir['email']) { global $domain; die ("<body>Your Account May Be Broken. Please Contact Your E-Mail Stating Your Username And User ID."); } if($dosessh && ($_SESSION['attacking'] || $ir['attacking'])) { print "You Lost All Your EXP For Running From A Fight Like A Coward."; $db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid"); $_SESSION['attacking']=0; } $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); $wiperc=(int) ($ir['will']/$ir['maxwill']*100); $experc=(int) ( $ir['exp']/$ir['exp_needed']*100); $brperc=(int) ($ir['brave']/$ir['maxbrave']*100); $hpperc=(int) ($ir['hp']/$ir['maxhp']*100); $enopp=100-$enperc; $wiopp=100-$wiperc; $exopp=100-$experc; $bropp=100-$brperc; $hpopp=100-$hpperc; $d=""; $stmr=""; $u=$ir['username']; if($ir['user_level'] > 1) { $stmr="[img=staffimage here]"; }; if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d="[img=donator.gif]"; } $gn=""; global $staffpage; $bgcolor = ''; print <<<OUT <center> <table border='1' width='100%' bordercolor='red' align='right'> <tr> <td> [img=title.jpg] </center> </td></tr></table><title>{$set['game_name']}</title> </center> <table border='1.0' width='100%' bordercolor='red' align='right'> <th>[b]Energy:[/b] {$enperc}%</th> <th>[b]Will:[/b] {$wiperc}%</th> <th>[b]Brave:[/b] {$ir['brave']}/{$ir['maxbrave']}</th> <th>[b]Respect: {$experc}%</th> <th>[b]Health</font>[/b] {$hpperc}%</th> </tr> <td><img src=ZBar.png width=$enperc height=10><img src=ZBar2.png width=$enopp height=10></td> <td><img src=ZBar.png width=$wiperc height=10><img src=ZBar2.png width=$wiopp height=10></td> <td><img src=ZBar.png width=$brperc height=10><img src=ZBar2.png width=$bropp height=10></td> <td><img src=ZBar.png width=$experc height=10><img src=ZBar2.png width=$exopp height=10></td> <td><img src=ZBar.png width=$hpperc height=10><img src=ZBar2.png width=$hpopp height=10> </td> </tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20%" bgcolor="#$bgcolor" valign="top"> <fieldset> [b]Welcome to <font color='red'>Dark City</font> </fieldset> <fieldset> <font color=silver>[i]<pre> [b]Name:[/b] $gn{$u} [{$ir['userid']}] $d [b]Money:[/b] {$fm} [b]Level:[/b] {$ir['level']} [b]Crystals:[/b] {$ir['crystals']} [[url='logout.php']Quick Logout[/url]] </font>[/i]</pre></fieldset> OUT; if($ir['fedjail']) { $q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid"); $r=$db->fetch_row($q); die("[b]<hr /><font color=red size=+1>You Have Been Dragged Off To {$set['game_name']} Federal Prision For {$r['fed_days']} Day(s).<hr /> Reason: {$r['fed_reason']}</font>[/b]</body></html>"); } if(file_exists('ipbans/'.$IP)) { die("[b]<font color=red size=+1><hr />Your IP Has Been Banned From {$set['game_name']}, There Is No Way Around This.<hr /></font>[/b]</body></html>"); } } function menuarea() { include "mainmenu.php"; global $ir,$c; $bgcolor = ''; print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"> </td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top"> <center>'; if($ir['hospital']) { print "[b]<hr />You Are In The Hospital The Doctors Think You Should Rest Abit For {$ir['hospital']} Minutes.<hr /> "; } if($ir['jail']) { print "[b]<hr />You Have Been Arrested And Hauled Off To The Local Jail {$ir['jail']} Minutes.<hr /> "; } print " <fieldset> [url='donator.php'][b]<pre>[i]<blink>Become A Donator To {$set['game_name']} Now For Extreme Featurez And Benefits!!</blink></pre>[/i][/b][/url]"; print "[url='vote.php'][b]<pre>[i]<blink>Vote For {$set['game_name']}!!</blink></pre>[/i][/b]</fieldset>[/url] "; } function smenuarea() { include "smenu.php"; global $ir,$c; $bgcolor = ''; print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"> </td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top"><center>'; } function endpage() { global $db; print <<<OUT </center> </td> </tr> </table></td> <td class="rgrad"></td> </tr> <tr> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl"> </td> <td class="dgrad"> </td> <td class="dgradr"> </td> </tr> </table> </td> </tr> </table> "Put Your Copyright" </body> </html> OUT; } } ?>
  11. Re: Number Game! [V2]   You pick a number.. the system outputs a number if you get the same number you win money if you don't you lose..
  12. Re: Number Game! [V2]   There's no difference? so why not?, I'm used to using $ir['userid']... its easy enough to type.. so why not Nothing i was just saying most v1 lite and v2 use $userid at the end of queries xD not $ir['userid'] :D Its cool dude, i use both xD both this time i used $ir['userid'] :P
  13. Re: Number Game! [V2]   There's no difference? so why not?, I'm used to using $ir['userid']... its easy enough to type.. so why not
  14. Save file as numbergame.php <?php include (DIRNAME(__FILE__) ."/globals.php"); $number=rand(1,20); // tweak the outcome number $money=rand(300,500); // tweak the outcome money if win! echo("Pick a number between 1 & 20!"); echo(" <form action='numbergame.php' method='post'> Pick a number: <input type='text' name='number' /> <input type='submit' value='submit' /> </form>"); if($_POST['number'] > 20) { die(""); exit; } if(!$_POST['number']) { die(""); exit; } else { if($_POST['number'] == $number) { echo sprintf("Woo, The number you inputed was correct! You won %s [url='game.php']Again?[/url]", number_format($money)); $money = sprintf("UPDATE users SET money = money + %u WHERE (userid = %u)", $money, $ir['userid']); $db->query($money); } else { echo sprintf("Sorry, The number was %s [url='game.php']Try Again[/url] ", number_format($number)); } } $h->endpage(); ?>   In explore add the following code [url='numbergame.php']Play a number game[/url]   Enjoy!
  15. Re: [mccode] Choose Gender   The topic name says it all. Basically md has added gender on to the register page and you get to choose between Male/Female. You can oredy do that on Mccodes :S
  16. Re: Daily Donators Reward [Mccode v2] Nice +1 Secured reward.php   <?php require "globals.php"; include (DIRNAME(__FILE__) ."/globals.php"; if ($ir['donatordays'] == 0) { echo "Sorry, This Feature is for Donators only!"; exit; } echo "<div class='tab'><center>Daily Donators Reward</center></div> [i]This Feature This only for donators you can request a reward once a day[/i] "; { $_GET['reward'] = isset($_GET['reward']) && is_string($_GET['reward']) ? strtolower(trim($_GET['reward'])) : ""; if($_GET['reward']) { if($ir['rewarddone'] > 1) { die ("You Have Already Got Your Reward Today Come Back Tomrw"); exit; } } } $num = rand(1, 5); $reward = sprintf("UPDATE users SET rewarddone = rewarddone + %u WHERE (userid = %u)", 1, $userid); $db->query($reward); $ir['money'] =100; switch($num) { case '1': $money =rand(500,1000); echo sprintf "<font color='blue'>You Gained $%u Money</font>", number_format($money); $money = sprintf("UPDATE users SET money = money + %u WHERE (userid = %u)", $money, $userid); $db->query($money); break; case '2': $crystal =rand(5,10); echo sprintf "<font color='blue'>You Gained %u Crystals</font>", number_format($crystal); $crystals = sprintf("UPDATE users SET crystals = crystals + %u WHERE (userid = %u)", $crystal, $userid); $db->query($crystals); break; case '3': $brave =rand(1,3); echo sprintf "<font color='blue'>You Gained %u Brave</font>", number_format($brave); $brave = sprintf("UPDATE users SET brave = brave + %u WHERE (brave < maxbrave AND userid = %u)", $brave, $userid); $db->query($brave); break; } print " <center>[url='reward.php?reward=?']Reward[/url]</center>"; { } $h->endpage(); ?>
  17. Re: [mccode] Choose Gender I really dont understand what is this mod?
  18. Re: Food Shop [Mccode V2]   In sprintf(); form   $money = sprintf("UPDATE users SET money = money - %u WHERE (userid = %u)", 10, $ir['userid']); $db->query($money);
  19. Re: Food Shop [Mccode V2]   <?php include(DIRNAME(__FILE__) . "/globals.php"); echo "<style type='text/css'> .table { background-color:#000000; } .table3 { background-color:#000000; } .table td { background-color:#999999; height:22px; } .table3 td { background-color:#000000; } td .alt { background-color:#0066FF; height:22px; } .table th { font-weight: bold; background-color: #A0A0A0; } </style>"; switch ($_GET['action']) { case 'buy': buy(); break; case 'bur': bur(); break; case 'pizza': pizza(); break; default: index(); break; } function index() { global $db,$ir,$userid; echo "<h4>Food Shop</h4> [i]Welcome To Our Food shop[/i] <table cellspacing='1' width='80%' class='table' cellspacing='1'> <tr> <th>Food Name</th> <th>Food Price</th> <th>Buy</th></tr> <tr> <td>Chips</td> <td>$2</td> <td>[url='my1.php?action=buy']Buy Chips[/url]</td></tr> <tr> <td>Burger</td> <td>$1</td> <td>[url='my1.php?action=bur']Buy Burger[/url]</td></tr> <tr> <td>Pizza</td> <td>$7</td> <td>[url='my1.php?action=pizza']Buy Pizza[/url]</td></tr></table> [i]Made By Mafia-Club[/i] "; } function buy() { global $db,$ir,$userid; if($ir['energy'] == $ir['maxenergy']) { echo "Energy Is Already Full Come Back When you Have Less Energy"; exit; } if ($ir['money'] < 1 ) { echo "Error: You Need Atleast $2 To Buy Chips"; } if($ir['money'] > 2 ) { echo "You Bought A Potion Of Chips Enjoy"; $money = sprintf("UPDATE users SET money = money - %u WHERE (userid = %u)", 5, $ir['userid']); $db->query($money); $energy = sprintf("UPDATE users SET energy = energy + %u WHERE (energy < maxenergy AND userid = %u)", 12, $ir['userid']); $db->query($energy); } } function bur() { global $db,$ir,$userid; if($ir['brave'] == $ir['maxbrave']) { echo "Brave Is Already Full Come Back Later When you Have Less Brave"; exit; } if($ir['money'] < 1) { echo "You Need Atleast $1 To Buy A burger"; } elseif($ir['money'] > 1 ) { echo "You Bought A Burger And Gained Brave"; $brave = sprintf("UPDATE users SET brave = brave + %u WHERE (brave < maxbrave AND userid = %u)", 1, $ir['userid']); $db->query($brave); $money = sprintf("UPDATE users SET money = money - %u WHERE (userid = %u)", 1, $ir['userid']); } } function pizza() { global $db,$ir,$userid; if($ir['hp'] == $ir['maxhp']) { global $db,$ir,$userid; echo "Your Health Is Already Full Come Back Later When You Have Less Health"; exit; } if($ir['money'] < 5 ) { echo "Error: You Need Atleast $7 To Buy A Pizza"; } elseif($ir['money'] > 7 ) { echo ":) You Just Bought A Pizza And will gain some health"; $money = sprintf("UPDATE users SET money = money - 7 WHERE (userid = %u)", 7, $ir['userid']); $db->query($money); $hp = sprintf("UPDATE users SET hp = hp + %u WHERE (hp < maxhp AND userid = %u)", 5, $ir['userid']); $db->query($hp); } } $h->endpage(); ?>   Hey!! You nicked my idea :P, its cool I'm going to make a version where theirs pics and stuff but here's a update on your security ;)
  20. Re: [Mccodes V2] Horse Racing (small mod) ---------NOT TESTED----------- Additional Security - May not work just Pm Me if it doesn't! <?php /* Created by ///TOLK\\\ Free for CE members Not to be Sold */ include (DIRNAME(__FILE__) . "/globals.php"); $tresder = (int) (rand(100,999)); $maxbet=$ir['level']*150; $_GET['tresde']=abs((int) $_GET['tresde']); if(($_SESSION['tresde'] == $_GET['tresde']) || $_GET['tresde']<100) $_SESSION['tresde']=$_GET['tresde']; $_GET['bet']=abs((int) $_GET['bet']); $_GET['number']=abs((int) $_GET['number']); print ' <table width="75%" border="1" cellspacing="0"> <tr> <td width="25%" bgcolor="#666666"><font color=white><center>#</center></font></td> <td width="25%" bgcolor="#666666"><font color=white><center>Horse Name</center></font></td> <td width="25%" bgcolor="#666666"><font color=white><center>Age</center></font></td> </tr> <tr> <td bgcolor="#999999">1</td> <td bgcolor="#999999">Affirmed</td> <td bgcolor="#999999"><center>6</center></td> </tr> <tr> <td bgcolor="#999999">2</td> <td bgcolor="#999999">Fourstardave</td> <td bgcolor="#999999"><center>7</center></td> </tr> <tr> <td bgcolor="#999999">3</td> <td bgcolor="#999999">Whirlaway</td> <td bgcolor="#999999"><center>4</center></td> </tr> <tr> <td bgcolor="#999999">4</td> <td bgcolor="#999999">Swaps</td> <td bgcolor="#999999"><center>8</center></td> </tr> <tr> <td bgcolor="#999999">5</td> <td bgcolor="#999999">Forego</td> <td bgcolor="#999999"><center>5</center></td> </tr> <tr> <td bgcolor="#999999">6</td> <td bgcolor="#999999">Kelso</td> <td bgcolor="#999999"><center>6</center></td> </tr> <tr> <td bgcolor="#999999">7</td> <td bgcolor="#999999">Ruffian</td> <td bgcolor="#999999"><center>7</center></td> </tr> <tr> <td bgcolor="#999999">8</td> <td bgcolor="#999999">Citation</td> <td bgcolor="#999999"><center>5</center></td> </tr> <tr> <td bgcolor="#999999">9</td> <td bgcolor="#999999">Secretariat</td> <td bgcolor="#999999"><center>6</center></td> </tr> <tr> <td bgcolor="#999999">10</td> <td bgcolor="#999999">Count Fleet</td> <td bgcolor="#999999"><center>9</center></td> </tr> <tr> <td bgcolor="#999999">11</td> <td bgcolor="#999999">Rambling Willie</td> <td bgcolor="#999999"><center>6</center></td> </tr> <tr> <td bgcolor="#999999">12</td> <td bgcolor="#999999">Genuine Risk</td> <td bgcolor="#999999"><center>4</center></td> </tr>'; print "<h3>Horse Racing: Pick a horse below and type the number</h3>"; if($_GET['bet']) { if($_GET['bet'] > $ir['money']) { die("You are trying to bet more than you have. [url='hr.php?tresde=$tresder']> Back[/url]"); } else if($_GET['bet'] > $maxbet) { die("You have gone over the max bet. [url='hr.php?tresde=$tresder']> Back[/url]"); } else if ($_GET['number'] > 12 or $_GET['number'] < 1 or $_GET['bet'] < 0) { die("The horses are only 1 - 12. [url='hr.php?tresde=$tresder']> Back[/url]"); } $slot[1]=(int) rand(1,12); print "You place your \${$_GET['bet']} on your horse. You see the number of the winning horse: [b]$slot[1][/b] You bet \${$_GET['bet']} "; if($slot[1]==$_GET['number']) { $won=$_GET['bet']*37; $gain=$_GET['bet']*36; echo sprintf("and won \$%u by matching the number of your horse pocketing you \$%u extra.", number_format($won), number_format($gain); } else { $won=0; $gain=-$_GET['bet']; print "and lost it."; } $money = sprintf("UPDATE users SET money = money + %u WHERE (userid = %u)", $gain, $ir['userid']); $db->query($money); $tresder = (int) (rand(100,999)); print " [url='hr.php?bet={$_GET[']> Another time, same horse and bet.[/url] [url='hr.php?tresde=$tresder']> I'll continue, but I'm changing my horse and/or bet.[/url] [url='explore.php']> Enough's enough, I'm off.[/url]"; } else { print "Ready to try your luck on a horse? Play today! <img src=horse.jpg width=150 height=100> The maximum bet for your level is \$$maxbet. <form action='hr.php' method='get'> Bet: \$<input type='text' name='bet' value='5' /> Pick (1-12) from the horses above: <input type='text' name='number' value='1' /> <input type='hidden' name='tresde' value='$tresder' /> <input type='submit' value='Start Race!!' /> </form>"; } $h->endpage(); ?>
  21. Re: Mccodes V2 Request Name Changes Open Preferances.php case 'sexchange2': do_sex_change(); break; case 'sexchange': conf_sex_change(); break; Underneath add case 'colorchange2': do_color_change(); break; case 'colorchange': conf_color_change(); break; Find <a href='preferences.php?action=sexchange'> underneath add Name Color Change Find function do_sex_change() { global $db,$ir,$c,$userid,$h; if($ir['gender'] == "Male") { $g="Female"; } else { $g="Male"; } $db->query("UPDATE users SET gender='$g' WHERE userid=$userid"); print "Success, you are now $g! [url='preferences.php']Back[/url]"; } Underneath add :   function conf_color_change() { global $db,$ir,$c,$userid,$h; echo("<form action='preferences.php?action=colorchange2'> method='post'> Color : <input type='text' name='color' /> <input type='submit' value='Change Color' /> </form> } function do_color_change() { global $db,$ir,$c,$userid,$h; echo("Color changed to {$_POST['color']}"); $db->query("UPDATE users SET color=color={$_POST['color']} WHERE userid=$userid"); } Open Header.php Find Name: replace with if($ir['color'] == "") { echo("Name:"); } else { echo("<font color='{$ir['color']}'>Name</font>); } Not sure it works first time using post XD
  22. Re: Another Addon   I never said there was anything special -.-
  23. Hey, Open staff_special.php Find $db->query("UPDATE users SET user_level={$_GET['level']} WHERE userid={$_GET['ID']}"); After that add if($_GET['level'] == 1) { $userl="Member"; } else if($_GET['level'] == 2) { $userl="Admin"; } else if($_GET['level'] == 3) { $userl="Secretary"; } else if($_GET['level'] == 4) { $userl="IRC Op"; } else if($_GET['level'] == 5) { $userl="Assistant"; }   Then Find: print "User's level adjusted.";   Replace with print "User's Level adjusted to {$userl}";   After that Find: stafflog_add("Adjusted user ID {$_GET['ID']}'s staff status.");   Replace with stafflog_add("Adjusted user ID {$_GET['ID']}'s staff status to {$userl}");   In staff.php In staff.php it will show what you have adjusted them to :)
  24. Re: Reward the active!   I'd just like to say this mod is not crap basically because how would they be a lot of money / crystals into the game? There is no automatic time where it gives money/crystals your responsible of giving it out.. I would only use this add on one's in a while not like everyday - Also i wouldn't just raid the game with all the free money or crystals!!
  25. Hi, I'm new to coding, I have made a mod/update really but it doesn't really work this is my 3rd mod i have made the first two have been successful but this one is a much bigger step seen as thought it is using $_GET['action']. I have tried my hardest to make this update, But iv given up. I would really appreciate if you would comment about the idea and try even fix the mod, Also i don't really know how to send a event to all the online users, I'm sure if someone can fix/add this therefore i can look at my mistakes and correct them for future coding. Well All i have to say, Here it is (Sorry if this mod has Already been made) Save as staff_rewards.php <?php include(DIRNAME(__FILE__) . "/sglobals.php"); switch($_GET['action']) { case 'reward_the_active': reward_the_active(); break; case 'reward_the_active_sub': reward_the_active_sub(); break; default: print "Error: This script requires an action."; break; } function reward_the_active() { global $db,$ir,$c; if($ir['user_level'] < 2) { die("403"); } echo(" <h3>Reward The Active Users!</h3><form action='staff_rewards.php?action=reward_the_active_sub' method='post'> Money: <input type='text' name='money' value=''/> Crystals: <input type='text' name='crystals' value=''/> <input type='submit' value='Reward The Online Users!' /> "); } function reward_the_active_sub() { global $db,$ir,$c,$h; $money=$db->escape($_POST['money']); $crystals=$db->escape($_POST['crystals']); $db->query("UPDATE users SET money=money+{$_POST['money']} WHERE laston>unix_timestamp()-15*60"); $db->query("UPDATE users SET crystals=crystals+{$_POST['crystals']} WHERE laston>unix_timestamp()-15*60"); print "The online users have been credited!"; } ?>   Open Smenu.php [url='staff_rewards.php?action=reward_the_active_sub']Reward The Active![/url]
×
×
  • Create New...