Jump to content
MakeWebGames

Magictallguy

Administrators
  • Posts

    2,123
  • Joined

  • Last visited

  • Days Won

    143

Everything posted by Magictallguy

  1. Re: [V2] Staff Items I've updated it to what you said..Still isn't having it.. :( function kill_itemtype_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Deleting Item Type</h3> The item type will be permanently removed from the game. <form action='staff_items.php?action=killitemtypesub' method='post'> Item Type: ".itemtype_dropdown($c,'itmtype')." <input type='submit' value='Kill Item Type' /></form>"; } function kill_itemtype_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM itemtypes WHERE itmtypeid={$_POST['itmtypeid']}"); $itemi=$db->fetch_row($d); $db->query("DELETE FROM itemtypes WHERE itmtypeid={$_POST['itmtypeid']}"); print "The item type {$itemi['itmtypename']} was removed from the game."; stafflog_add("Deleted item type {$itemi['itmtypename']}"); }
  2. Re: [V2] Staff Items Ah yea.. Right there in front of me! xD - Thanks!
  3. Re: Casino with slots [V2] Last 2
  4. Re: Casino with slots [V2] More! 7 and 7i are the same number but different styles..
  5. Re: Casino with slots [V2] Here's the images I've just made - Not perfect though....
  6. Re: Quantify Mod for V2! I retract my previous post...I had somehow misspelt $currdel with urrdel O_o
  7. Re: Quantify Mod for V2! Well it still doesn't like the code... <?php include "globals.php"; $used=array(); $q=$db->query("SELECT * FROM inventory WHERE inv_userid=$userid"); while ( $r=$db->fetch_row($q) ) { if ( ! in_array ( $r['inv_id'], $used ) ) { $currdel=array(); $used[] =$r['inv_id']; $currdel[]=$r['inv_id']; $amount=$r['inv_qty']; //grab sellers others $q2=$db->query("SELECT * FROM inventory WHERE inv_userid=$userid AND inv_itemid = {$r['inv_itemid']} AND inv_id != {$r['inv_id']}"); while ( $r2 = $db->fetch_row($q2) ) { $used[]=$r2['inv_id']; $currdel[]=$r2['inv_id']; $amount+=$r2['inv_qty']; } $db->query("DELETE FROM inventory WHERE inv_id IN(".implode(","urrdel).")"); $db->query("INSERT INTO inventory VALUES('', {$r['inv_itemid']}, $userid, $amount)"); print "$amount of item id {$r['inv_itemid']} quantified... "; } } print "[b]<font color='red'>Quantifying Done</font>[/b] <hr width=50%><center><a href=inventory.php>>Back to your Items</a> <hr width=50%>"; $h->endpage(); ?>   Error is on line 19: $db->query("DELETE FROM inventory WHERE inv_id IN(".implode(","urrdel).")");   Doesn't like that: Parse error: syntax error, unexpected T_STRING in /quantify.php on line 19
  8. Re: battlearena SQL: (Isomerisers...so I don't know why I'm posting it again..)   CREATE TABLE `battlearena` ( `batid` int(11) NOT NULL auto_increment, `p1` int(11) NOT NULL default '0', `p2` int(11) NOT NULL default '0', `p3` int(11) NOT NULL default '0', `p4` int(11) NOT NULL default '0', `p5` int(11) NOT NULL default '0', `p6` int(11) NOT NULL default '0', `p7` int(11) NOT NULL default '0', `p8` int(11) NOT NULL default '0', `p9` int(11) NOT NULL default '0', `p10` int(11) NOT NULL default '0', `lastwinner` int(11) NOT NULL default '0', PRIMARY KEY (`batid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  9. Re: [mccode][v1]+[v2]Automatic total cost calculation in shop buy. And for those who don't understand what to do: The entire shops.php script (for v2) <?php include "globals.php"; $_GET['shop'] = abs((int) $_GET['shop']); if(!$_GET['shop']) { print "You begin looking through town and you see a few shops. "; $q=$db->query("SELECT * FROM shops WHERE shopLOCATION={$ir['location']}"); print "<table width=85% cellspacing=1 class='table'><tr style='background: gray;'><th>Shop</th><th>Description</th></tr>"; while($r=$db->fetch_row($q)) { print "<tr><td>[url='shops.php?shop={$r[']{$r['shopNAME']}[/url]</td><td>{$r['shopDESCRIPTION']}</td></tr>"; } print "</table>"; } else { $sd=$db->query("SELECT * FROM shops WHERE shopID={$_GET['shop']}"); if($db->num_rows($sd)) { $shopdata=$db->fetch_row($sd); if($shopdata['shopLOCATION'] == $ir['location']) { print "Browsing items at [b]{$shopdata['shopNAME']}...[/b] <table cellspacing=1 class='table'><tr style='background: gray;'><th>Item</th><th>Description</th><th>Price</th><th>Sell Price</th><th>Buy</th></tr>"; $qtwo=$db->query("SELECT si.*,i.*,it.* FROM shopitems si LEFT JOIN items i ON si.sitemITEMID=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE si.sitemSHOP={$_GET['shop']} ORDER BY i.itmtype ASC, i.itmbuyprice ASC, i.itmname ASC"); $lt=""; ?> <script language="Javascript" type="text/javascript"> //<![CDATA[ function moneyformat(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); cents = num%100; num = Math.floor(num/100).toString(); if(cents<10) cents = "0" + cents; for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + '$' + num); } function tot(id,a,b) { var c=a*Math.round(b); var d=moneyformat(c); document.getElementById("res" + id).innerHTML = d; } function clearText(thefield){ if (thefield.defaultValue==thefield.value) thefield.value = "" } function returnText(thefield){ if (thefield.value=='' || thefield.value==0) thefield.value = thefield.defaultValue } //]]> </script> <?php while($r=$db->fetch_row($qtwo)) { if($lt!=$r['itmtypename']) { $lt=$r['itmtypename']; print "\n<tr style='background: gray;'><th colspan=5>{$lt}</th></tr>"; } $buyprice=money_formatter($r['itmbuyprice']); $sellprice=money_formatter($r['itmsellprice']); ?><tr><td><? echo $r['itmname']; ?></td><td><? echo $r['itmdesc']; ?></td><td><? echo $buyprice; ?></td><td><? echo $sellprice; ?></td><td><form action='itembuy.php?ID=<? echo $r['itmid']; ?>' name="shopbuy" method='post'> Qty: <input type='text' name='qty' value='1' onkeyup="tot(<? echo $r['itmid']; ?>,<? echo $r['itmbuyprice']; ?>,this.value);" onfocus="clearText(this);" onblur="returnText(this);" /><input type='submit' value='Buy' /></form><div id="res<? echo $r['itmid']; ?>" align="center"><? echo $buyprice; ?></div></td></tr> <? } print "</table>"; } else { print "You are trying to access a shop in another city!"; } } else { print "You are trying to access an invalid shop!"; } } $h->endpage(); ?>
  10. Re: [V1]Paper Boy Panel With New User Level[V1] For v2! Create a file called staff_newspaperpanel.php <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- Paper Boy Panel -- Created By Klikoka -- MCR For Life !! Peace -- Converted to v2 by Magictallguy -----------------------------------------------------*/ include "globals.php"; if($ir['user_level'] != 2 && $ir['user_level'] != 3 && $ir['user_level'] != 5 && $ir['user_level'] !=6) { die("You sneak, get out of here!"); } switch($_GET['action']) { case 'editnews': newspaper_form(); break; case 'subnews': newspaper_submit(); break; default: print "Error: This script requires an action."; break; } $posta=$db->real_escape_string(print_r($_POST,1)); $geta=$db->real_escape_string(print_r($_GET,1)); function newspaper_form() { global $db,$ir,$h,$userid; $q=$db->query("SELECT * FROM papercontent LIMIT 1"); $news=$db->result($q,0,0); print "<h3>Editing Newspaper</h3><form action='staff_newspaperpanel.php?action=subnews' method='post'> <textarea rows='7' cols='35' name='newspaper'>$news</textarea> <input type='submit' value='Change' /></form>"; } function newspaper_submit() { global $db,$ir,$h,$userid; $news=$_POST['newspaper']; $db->query("UPDATE papercontent SET content='$news'"); print "Newspaper updated!"; } } $h->endpage(); ?>   Edit stafflist.php to show this (where you want it) print "[b]Paper Boy[/b] <table width=80%> <tr style='background:gray'> <th>User</th> <th>Level</th> <th>Money</th> <th>Last Seen</th> <th>Status</th> </tr>"; foreach($staff as $r) { if($r['user_level']==6) { if($r['laston'] >= time()-15*60) { $on="<font color=green>[b]Online[/b]</font>"; } else { $on="<font color=red>[b]Offline[/b]</font>"; } print "<tr> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td> <td>{$r['level']}</td> <td>\${$r['money']}</td> <td>".date('F j, Y, g:i:s a',$r['laston'])."</td> <td>$on</td> </tr>"; } } print "</table>"; If you want that into GMT simply replace <td>".date('F j, Y, g:i:s a',$r['laston'])."</td> with <td>".date('F j, Y, g:i:s a',$r['laston'] + (6 * 60 * 60))."</td>   Add the links into the smenu.php print "> [url='staff_newspaperpanel.php?action=editnews']Edit the Newspaper[/url] ";   Now people that wasn't really hard was it?
  11. Hey people. I'm trying to create a kill itemtype function in the staff_items.php script. I've got most of it right..Up until the SELECT query.. function kill_itemtype_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); }   print "<h3>Deleting Item Type</h3> The item type will be permanently removed from the game. <form action='staff_items.php?action=killitemtypesub' method='post'> Item Type: ".itemtype_dropdown($c,'itmtype',$itemi['itmtype'])." <input type='submit' value='Kill Item Type' /></form>"; } function kill_itemtype_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM itemtypes WHERE itmtypeid={$_POST['itemtype']}"); $itemi=$db->fetch_row($d); $db->query("DELETE FROM itemtypes WHERE itmtypeid={$_POST['itmtypeid']}"); print "The item type {$itemi['itmtypename']} was removed from the game."; stafflog_add("Deleted item type {$itemi['itmtypename']}"); }   Can anyone enlighten me as to why it doesn't like that please? QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Query was SELECT * FROM itemtypes WHERE itmtypeid=
  12. Re: [v1] Bar Room w/ Chat FREE Though there is a slight problem with the code. It doesn't actually show a place to submit a message - I'm too tired to fix!
  13. Re: [v1] Bar Room w/ Chat FREE Here's the fixed version (also the tables were screwed up so I fixed those too!) Oh and it's v2! <?php include "globals.php"; if(!$_GET['spend']) { print "<h2>The Bar Room</h2> Hi and welcome , what would you like?. Prices and payment options are listed below. <h3>Drink Menu</h3> <table border='1' width='90%' bordercolor='#939393'> <tr background='header.jpg'> <th>Drinks</th> <th>Price</th> <th><center>Buy</th> </tr> <tr> <td><center>Gin and Juice</td> <td><center>$1,000,000</td> <td><center>[url='barroom.php?spend=Juice']Buy[/url]</td> </tr> <tr> <td><center>Beer</td> <td><center>$5,000,000</td> <td><center>[url='barroom.php?spend=Beer']Buy[/url]</td> </tr> <tr> <td><center>Brandy</td> <td><center>$7,000,000</td><td><center>[url='barroom.php?spend=Brandy']Buy[/url]</td> </tr> <tr> <td><center>Tequila</td> <td><center>$10,000,000</td> <td><center>[url='barroom.php?spend=Tequila']Buy[/url]</td> </tr> </table> <h3>Bar Room Chatter</h3>"; //Start Shoutbox $_POST['message']=mysql_real_escape_string($_POST['message']); $_POST['message']=strip_tags($_POST['message']); $_POST['message']=htmlentities($_POST['message'], ENT_QUOTES); if($_POST['message'] != "") { $db->query("INSERT INTO shoutbox VALUES('',{$ir['userid']},'{$_POST['message']}',unix_timestamp())") or die ($db->error()); print "[i]Shout posted in shout box.[/i]"; } else { print <<<EOF <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function disableForm(theform) { if (document.all || document.getElementById) { for (i = 0; i < theform.length; i++) { var tempobj = theform.elements[i]; if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset") tempobj.disabled = true; } return true; } else { return false; } } // End --> </script> EOF; print " "; } if($_GET['spend'] == Juice) { if($ir['money'] <1000000) { print "You don't have enough money to buy a pint of beer , Get out of my PUB!"; } else { $db->query("UPDATE users SET will=will+35,energy=0,money=money-1000000 WHERE userid=$userid"); $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "<center>You payed the Bartender \$1,000,000,and then drank your juice . You feel some of your will coming back to you. [url='index.php']>Home[/url]</center>"; } } else if($_GET['spend'] == Beer) { if($ir['money'] <5000000) { print "You don't have enough money to buy a pint of beer , Get out of my PUB!"; } else { $db->query("UPDATE users SET will=will+70,energy=0,money=money-5000000 WHERE userid=$userid"); $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "<center>You payed the Bartender $5,000,000, and then drank your beer. You feel some of your will coming back to you. [url='index.php']>Home[/url]</center>"; } } else if($_GET['spend'] == Brandy) { if($ir['money'] <10000000) { print "You don't have enough money to buy a pint of beer , Get out of my PUB!"; } else { $db->query("UPDATE users SET will=will+210,energy=0,money=money-10000000 WHERE userid=$userid"); $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "<center>You payed the Bartender \$10,000,000, and then drank your Brandy. You feel some of your will coming back to you. [url='index.php']>Home[/url]</center>"; } } else if($_GET['spend'] == Tequila) { if($ir['money'] <10000000) { print "You don't have enough money to buy a pint of beer , Get out of my PUB!"; } else { $db->query("UPDATE users SET will=will-50,energy=+250,money=money-10000000 WHERE userid=$userid"); $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "<center>You payed the Bartender $10,000,000, and then drank your tequila. You feel Dizzy , Then you feel some of your energy coming back to you. [url='index.php']>Home[/url]</center>"; } } } $h->endpage(); ?>
  14. Re: [v1] Bar Room w/ Chat FREE And I am that friend! :P
  15. Re: BOUNTER hunter v2 mod This isn't a free mod...Why are you posting it here?
  16. Re: Delete Yea, like he cares...His game is gonna be pretty crap anyway... And badboy, next time you post code, can you encase it in the BBCode [ code ] tags please. I'm sick of scrolling through almost an A3 sheet!
  17. Re: Honour exchange error Though this really shouldn't here, here's my answer (and it works for me) Find all instances where it has the mny_stripfmt and delete that line.
  18. Re: [free] Staff Delete Gang Option [V2]   Just to be annoying :P function mail_send() { global $ir,$c,$userid,$h; $subj=str_replace(array("\n"),array(" "),strip_tags($_POST['subject'])); $msg=str_replace(array("\n"),array(" "),strip_tags($_POST['message'])); $codes = array(":)", ";)", ":o",":O", ":d",":D", ":s", ":S", ":(", ":red", ":clown", ":bashful", ":x", ":green", ":|", ";(", ":]", ":horny", ":cool"); $images = array("<img src=/smilies/smiley1.gif>", "<img src=/smilies/smiley2.gif>", "<img src=/smilies/smiley3.gif>", "<img src=/smilies/smiley3.gif>", "<img src=/smilies/smiley4.gif>", "<img src=/smilies/smiley4.gif>", "<img src=/smilies/smiley5.gif>", "<img src=/smilies/smiley5.gif>", "<img src=/smilies/smiley6.gif>", "<img src=/smilies/smiley7.gif>", "<img src=/smilies/smiley8.gif>", "<img src=/smilies/smiley9.gif>", "<img src=/smilies/smiley10.gif>", "<img src=/smilies/smiley11.gif>", "<img src=/smilies/smiley12.gif>", "<img src=/smilies/smiley13.gif>", "<img src=/smilies/smiley14.gif>", "<img src=/smilies/smiley15.gif>", "<img src=/smilies/smiley16.gif>"); $newmsg = str_replace($codes, $images, $msg); $to= (int) $_POST['userid']; $db->query("INSERT INTO mail VALUES ('',0,$userid,$to,unix_timestamp(),'$subj','$newmsg')") print "Message sent. [url='mailbox.php']> Back[/url]";
  19. Re: Problem   <?php include "globals.php"; $filters=array( 'nodon' => 'AND donatordays=0', 'don' => 'AND donatordays > 0', 'all' => ''); $filter=(isset($filters[$_GET['filter']])) ? $_GET['filter'] : 'all'; $myf=$filters[$filter]; $bt1=($filter=="nodon") ? "[b]" : ""; $bet1=($filter=="nodon") ? "[/b]" : ""; $bt2=($filter=="don") ? "[b]" : ""; $bet2=($filter=="don") ? "[/b]" : ""; $bt3=($filter=="all") ? "[b]" : ""; $bet3=($filter=="all") ? "[/b]" : ""; print "<h3>Hall Of Fame</h3><hr /> Filter: [$bt1[url='halloffame.php?action={$_GET[']Non-Donators[/url]$bet1 | $bt2[url='halloffame.php?action={$_GET[']Donators[/url]$bet2 | $bt3[url='halloffame.php?action={$_GET[']All Users[/url]$bet3]<hr /> <table width=75% cellspacing=1 class='table'> <tr> <td>[url='halloffame.php?action=level&filter={$filter}']LEVEL[/url]</td> <td>[url='halloffame.php?action=money&filter={$filter}']MONEY[/url]</td> <td>[url='halloffame.php?action=respect&filter={$filter}']RESPECT[/url]</td> <td>[url='halloffame.php?action=crystals&filter={$filter}']CRYSTALS[/url]</td> <td>[url='halloffame.php?action=total&filter={$filter}']TOTAL STATS[/url]</td> </tr> <tr> <td>[url='halloffame.php?action=strength&filter={$filter}']STRENGTH[/url]</td> <td>[url='halloffame.php?action=agility&filter={$filter}']AGILITY[/url]</td> <td>[url='halloffame.php?action=guard&filter={$filter}']GUARD[/url]</td> <td>[url='halloffame.php?action=labour&filter={$filter}']LABOUR[/url]</td> <td>[url='halloffame.php?action=iq&filter={$filter}']IQ[/url]</td> </tr> </table>"; switch($_GET['action']) { case "level": hof_level(); break; case "money": hof_money(); break; case "crystals": hof_crystals(); break; case "respect": hof_respect(); break; case "total": hof_total(); break; case "strength": hof_strength(); break; case "agility": hof_agility(); break; case "guard": hof_guard(); break; case "labour": hof_labour(); break; case "iq": hof_iq(); break; } function hof_level() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest levels <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Level</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY level DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t{$r['level']}$et</td> </tr>"; } print "</table>"; } function hof_money() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest amount of money <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Money</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY money DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t\$".money_formatter($r['money'],'')."$et</td> </tr>"; } print "</table>"; } function hof_crystals() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest amount of crystals <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Crystals</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY crystals DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t".money_formatter($r['crystals'],'')."$et</td> </tr>"; } print "</table>"; } function hof_respect() { global $db,$ir,$c,$userid; print "Showing the 20 gangs with the highest amount of respect <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>Gang</th> <th>Respect</th> </tr>"; $q=$db->query("SELECT * FROM gangs ORDER BY gangRESPECT DESC,gangID ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['gangID'] == $ir['gang']) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangNAME']} [{$r['gangID']}]$et</td> <td>$t".money_formatter($r['gangRESPECT'],'')."$et</td> </tr>"; } print "</table>"; } function hof_total() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest total stats <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY (us.strength+us.agility+us.guard+us.labour+us.IQ) DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table>"; } function hof_strength() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest strength <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.strength DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table>"; } function hof_agility() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest agility <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.agility DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table>"; } function hof_guard() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest guard <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.guard DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table>"; } function hof_labour() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest labour <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.labour DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table>"; } function hof_iq() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest IQ <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.IQ DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="[b]";$et="[/b]"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table>"; } $h->endpage(); ?>
  20. Re: Delete   Does badboy act stoopid on purpose? :P
  21. Re: [v1]Refill Users Create a new file called staff_refil.php   <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains refil stuffs switch($_GET['action']) { case 'cwill': update_will(); break; case 'cbrave': update_brave(); break; case 'chp': update_hp(); break; case 'cenergy': update_energy(); break; case 'chospital': update_hospital(); break; case 'call': update_all(); break; case 'cmost': update_most(); break; default: print "Error: This script requires an action."; break; } function update_will() { global $db,$ir,$h,$userid; $db->query("UPDATE users SET will=maxwill"); print "All users have been refilled, Will! [url='staff.php']> Back[/url]"; } function update_energy() { global $db,$ir,$h,$userid; $db->query("UPDATE users SET energy=maxenergy"); print "All users have been refilled, Energy! [url='staff.php']> Back[/url]"; } function update_brave() { global $db,$ir,$h,$userid; $db->query("UPDATE users SET brave=maxbrave"); print "All users have been refilled, Brave! [url='staff.php']> Back[/url]"; } function update_hp() { global $db,$ir,$h,$userid; $db->query("UPDATE users SET hp=maxhp"); print "All users have been refilled, Health! [url='staff.php']> Back[/url]"; } function update_hospital() { global $db,$ir,$h,$userid; $db->query("UPDATE users SET hospital=''"); $db->query("UPDATE users SET hospreason = ''"); print "All users have been let out of hospital! [url='staff.php']> Back[/url]"; } function update_most() { global $db,$ir,$h,$userid; $db->query("UPDATE users SET will=maxwill"); $db->query("UPDATE users SET energy=maxenergy"); $db->query("UPDATE users SET brave=maxbrave"); $db->query("UPDATE users SET hp=maxhp"); print "All bars have been refilled! [url='staff.php']> Back[/url]"; } function update_all() { global $db,$ir,$h,$userid; $db->query("UPDATE users SET will=maxwill"); $db->query("UPDATE users SET energy=maxenergy"); $db->query("UPDATE users SET brave=maxbrave"); $db->query("UPDATE users SET hp=maxhp"); $db->query("UPDATE users SET hospital=''"); $db->query("UPDATE users SET hospreason = ''"); print "All bars have been refilled and all users let out of hospital! [url='staff.php']> Back[/url]"; } $h->endpage(); ?>   Put into smenu.php (whever you want it to show) <hr /> [b]Refilling people (not being dirty :P)[/b] > [url='staff_refil.php?action=cwill']Refil Will[/url] > [url='staff_refil.php?action=cbrave']Refil Brave[/url] > [url='staff_refil.php?action=chp']Refil Health[/url] > [url='staff_refil.php?action=cenergy']Refil Energy[/url] > [url='staff_refil.php?action=chospital']Let everyone out of hospital[/url] > [url='staff_refil.php?action=cmost']Refil All Bars[/url] > [url='staff_refil.php?action=call']Refil All Bars And Let Everyone Out Of Hospital/Jail[/url]
  22. Re: [v1]Refill Users I'll post for v2 now..
  23. Re: Free Loan Shark System   <?php 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(); switch($_GET['action']) { case 'borrow': borrow_money_start(); break; case 'borrowed': borrow_money(); break; case 'repay': repay_money_start(); break; case 'repayed': repay_money(); break; case 'invest': invest_money(); break; case 'invested': invested_money(); break; default: loanshark_main(); break; } function loanshark_main() { global $ir,$c,$userid,$h; $maxloan=$ir['level']*50000; echo "<h2>Loan Shark</h2> You currently have a loan of \${$ir['loan']} The max you can loan is \$$maxloan - [url='loanshark.php?action=borrow']Loan Money[/url] - [url='loanshark.php?action=repay']Repay Loan[/url] - [url='loanshark.php?action=invest']Invest Money[/url] "; } function borrow_money_start() { global $ir,$c,$userid,$h; $maxloan=$ir['level']*50000; echo "The max amount you can borrow is \$$maxloan You currently have a lone of \${$ir['loan']} <form action='loanshark.php?action=borrowed' method='post'> Ammount: <input type=text value='$maxloan' name=borrowed> <input type=submit value='Borrow'>"; } function borrow_money() { global $ir,$c,$userid,$h; $maxloan=$ir['level']*50000; $loan=$ir['loan']; if ($loan == $maxloan) { die("You have already taken out the max loan possible you must pay it back before you can loan more > [url='loanshark.php?action=repay']Repay[/url]"); } if ($_POST['borrowed'] >= $maxloan) { die("You are trying to loan more then your max lone > [url='loanshark.php?action=borrow']Back[/url]"); } mysql_query("UPDATE users SET loan=loan+{$_POST['borrowed']} WHERE userid=$userid",$c); mysql_query("UPDATE users SET money=money+{$_POST['borrowed']} WHERE userid=$userid",$c); echo"You Borrowed from the loan shark > [url='loanshark.php']Back[/url]"; } function repay_money_start() { global $ir,$c,$userid,$h; echo"You have a lone of \${$ir['loan']} <form action='loanshark.php?action=repayed' method='post'> Ammount: <input type=text value='{$ir['loan']}' name=repayed> <input type=submit value='Repay'>"; } function repay_money() { global $ir,$c,$userid,$h; if($ir['loan'] <= 0) { die("You are trying to payback more then u have to > [url='loanshark.php']Back[/url]"); } mysql_query("UPDATE users SET loan=loan-{$_POST['repayed']} WHERE userid=$userid",$c); mysql_query("UPDATE users SET money=money-{$_POST['repayed']} WHERE userid=$userid",$c); echo"You repayed the loan shark > [url='loanshark.php']Back[/url]"; } function invest_money() { global $ir,$c,$userid,$h; echo"Here you can invest money on the spot and watch your money sink or float its simple you state the ammount you wish to invest in the box below and click Invest You have [b]{$ir['investments']}[/b] dayily invest statment's left <form action='loanshark.php?action=invested' method='post'> Ammount: \$<input type=text name=invest> <input type=submit value='Invest'> "; } function invested_money() { global $ir,$c,$userid,$h; if ($ir['investments'] < 1) { die("You have used up all your dayily investments > [url='loanshark.php?action=invest']Back[/url]"); } if(rand(1,100) <= 50) { $gainedmoney=(int) rand(1,30); print "<font color=green>[b]Result: You hand over {$_POST['invest']} to the old man at the counter One week later you get a phone call its the old man he explains that your investment has payed off You invested ${$_POST['invest']} and ended up making \$$gainedmoney extra.</font>[/b] You have [b]{$ir['investments']}[/b] dayily invest statment's left > [url='loanshark.php?action=invest']Try Again[/url]"; mysql_query("UPDATE users SET investments=investments-1",$c); mysql_query("UPDATE users SET money=money+$gainedmoney WHERE userid=$userid",$c); } else { if ($ir['investments'] < 1) { die("You have used up all your dayily investments > [url='loanshark.php?action=invest']Back[/url]"); } $lostmoney=(int) rand(1,10); mysql_query("UPDATE users SET money=money-$lostmoney WHERE userid=$userid", $c); echo"<font color=red>[b]Result: You invested \${$_POST['invest']} and lost \$$lostmoney out of your overall investment. One week later you get a phone call its the old man he explains that your investment has failed </font>[/b] You have [b]{$ir['investments']}[/b] dayily invest statment's left > [url='loanshark.php?action=invest']Try Again[/url] "; mysql_query("UPDATE users SET investments=investments-1",$c); } } $h->endpage(); ?>
  24. Re: Free Loan Shark System I'll tidy it up now!
  25. Re: Delete For the school...The code should already be there.. cron_day.php (about half way down)   $q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})");
×
×
  • Create New...