Jump to content
MakeWebGames

Brad

Members
  • Posts

    173
  • Joined

  • Last visited

Brad's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. But there is a chance to get put in jail or hospital but this is only simple.
  2. Well as for the spellings im dyslectic i cant spell as well but it still works.
  3. the $mrandom was gonna make it random money but i didn't do it and forgot to get it off and for the hospital and jail reasons i haven't coded mods for mccode for a while and forgot to put them in.
  4. I have not done mccode mods for a while so im not sure it this is right. This is a rob mod you are able to rob stuff and it is random every time. Comment what you think of it :). rob.php <?php //Made by brad /*This mod you are able to rob a shop to gain somthing for it */ include "globals.php"; $random = rand(1,10); $mrandom = rand(1,50000); if($random == 1){ $db->query("UPDATE users SET money=money+5000 WHERE userid=$userid"); print "You robbed the shop and stoel $5000"; $h->endpage(); }else if($random == 2){ $db->query("UPDATE users SET money=money-250, hospital=hospital+50 WHERE userid=$userid"); print "You got mugged while trying to rob the shop you are in hospital for a while and he stoel $250."; $h->endpage(); }else if($random == 3){ $db->query("UPDATE users SET crystal=crystal+500 WHERE userid=$userid"); print "You ran it puled out you gun and you gained 500 crystals which was on the counter."; $h->endpage(); }else if($random == 4){ $db->query("UPDATE user SET jail=jail+25 WHERE userid=$userid"); print "You pulled out the gun while there where police in the shop you go taken down and put in jail."; $h->endpage(); }else if($random == 5){ print "The shop door was locked you can get in."; $h->endpage(); }else{ print "There is an error."; } ?> Thanks Brad
  5. Brad

    Mail logs

    but you need it so you can see what goes on in your game mail. But you could probs add a cron like every day or something it clears the mail logs
  6. Brad

    Mail logs

    Thanks But it is just the mccode lite mailbox just where i changed that when the mail is sent goes into 2 fields so one can be deleted.
  7. Ok so in mccode lite im not sure if it's the same in v2 but when someone sends a mail it goes to the mail logs in the game but if that person deletes the mail it goes away from the mail logs and your databass. So what i have done is made it so all users are able to delete there mail but all mail also go into another field so you can read the mail after they have been deleted by the user. This is only for mccode lite.   Open mailbox.php and replace with <?php /* MCCodes Lite mailbox.php Rev 1.0.0 Copyright (C) 2006 Dabomstew This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 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']); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm); $h->menuarea(); if($ir['mailban']) { die("<font color=red><h3>! ERROR</h3> You have been mail banned for {$ir['mailban']} days. [b]Reason: {$ir['mb_reason']}</font>[/b]"); } $_GET['ID'] = abs((int) $_GET['ID']); print "<table width=75% border=2><tr><td>[url='mailbox.php?action=inbox']Inbox[/url]</td> <td>[url='mailbox.php?action=outbox']Outbox[/url]</td> <td>[url='mailbox.php?action=compose']Compose Message[/url]</td> <td>[url='mailbox.php?action=delall']Delete All Messages[/url]</td> "; switch($_GET['action']) { case 'inbox': mail_inbox(); break; case 'outbox': mail_outbox(); break; case 'compose': mail_compose(); break; case 'delete': mail_delete(); break; case 'send': mail_send(); break; case 'delall': mail_delall(); break; case 'delall5': mail_delall(); break; case 'delall2': mail_delall2(); break; case 'archive': mail_archive(); break; default: mail_inbox(); break; } function mail_inbox() { global $ir,$c,$userid,$h; print "Only the last 25 messages sent to you are visible. <table width=75% border=2><tr style='background:gray'><th>From</th><th>Subject/Message</th></tr>"; $q=mysql_query("SELECT m.*,u.* FROM mail m LEFT JOIN users u ON m.mail_from=u.userid WHERE m.mail_to=$userid ORDER BY mail_time DESC LIMIT 25",$c); while($r=mysql_fetch_array($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td>"; if($r['userid']) { print "[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]"; } else { print "SYSTEM"; } $fm=urlencode($r['mail_text']); print "</td>\n<td>{$r['mail_subject']}</td></tr><tr><td>Sent at: $sent [url='mailbox.php?action=compose&ID={$r[']Reply[/url] [url='mailbox.php?action=delete&ID={$r[']Delete[/url] [url='preport.php?ID={$r[']Report[/url]</td><td>{$r['mail_text']}</td></tr>"; } mysql_query("UPDATE mail SET mail_read=1 WHERE mail_to=$userid",$c); } function mail_outbox() { global $ir,$c,$userid,$h; print "Only the last 25 messages you have sent are visible. <table width=75% border=2><tr style='background:gray'><th>To</th><th>Subject/Message</th></tr>"; $q=mysql_query("SELECT m.*,u.* FROM mail m LEFT JOIN users u ON m.mail_to=u.userid WHERE m.mail_from=$userid ORDER BY mail_time DESC LIMIT 25",$c); while($r=mysql_fetch_array($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td><td>{$r['mail_subject']}</td></tr><tr><td>Sent at: $sent </td><td>{$r['mail_text']}</td></tr>"; } } function mail_compose() { global $ir,$c,$userid,$h; print "<form action='mailbox.php?action=send' method='post'> <table width=75% border=2> <tr> <td>ID to send to:</td> <td><input type='text' name='userid' value='{$_GET['ID']}' /></td></tr><tr> <td>Subject:</td> <td><input type='text' name='subject' /></td></tr><tr> <td>Message:</td> <td><textarea rows=5 cols=40 name='message'></textarea></td></tr><tr> <td colspan=2><input type='submit' value='Send' /></td></tr></table></form>"; if($_GET['ID']) { print " <table width=75% border=2><tr><td colspan=2>[b]Your last 5 mails to/from this person:[/b]</td></tr>"; $q=mysql_query("SELECT m.*,u1.username as sender from mail m left join users u1 on m.mail_from=u1.userid WHERE (m.mail_from=$userid AND m.mail_to={$_GET['ID']}) OR (m.mail_to=$userid AND m.mail_from={$_GET['ID']}) ORDER BY m.mail_time DESC LIMIT 5",$c); while($r=mysql_fetch_array($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td>$sent</td> <td>[b]{$r['sender']} wrote:[/b] {$r['mail_text']}</td></tr>"; } print "</table>"; } } 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'])); $to= (int) $_POST['userid']; mysql_query("INSERT INTO mail VALUES ('',0,$userid,$to,unix_timestamp(),'$subj','$msg')",$c) or die(mysql_error()); mysql_query("INSERT INTO mailall VALUES ('',0,$userid,$to,unix_timestamp(),'$subj','$msg')",$c) or die(mysql_error()); print "Message sent. [url='mailbox.php']> Back[/url]"; } function mail_delete() { global $ir,$c,$userid,$h; mysql_query("DELETE FROM mail WHERE mail_id={$_GET['ID']} AND mail_to=$userid",$c); print "Message deleted. [url='mailbox.php']> Back[/url]"; } function mail_delall() { global $ir,$c,$userid,$h; print "This will delete all the messages in your inbox. [url='mailbox.php?action=delall5']> Yes[/url] [url='mailbox.php']> No[/url]"; } function mail_delall5() { global $ir,$c,$userid,$h; print "Are you sure You [b]<font color=red>Cannot</font>[/b] undo this. [url='mailbox.php?action=delall2']> Yes. I am sure.[/url] [url='mailbox.php']> No, go back[/url]"; } function mail_delall2() { global $ir,$c,$userid,$h; mysql_query("DELETE FROM mail WHERE mail_to=$userid",$c); print "All ".mysql_affected_rows($c)." mails in your inbox were deleted. [url='mailbox.php']> Back[/url]"; } function mail_archive() { global $ir,$c,$userid,$h; print "This tool will download an archive of all your messages. [url='dlarchive.php?a=inbox']> Download Inbox[/url] [url='dlarchive.php?a=outbox']> Download Outbox[/url]"; } $h->endpage(); ?>   Open admin.php Find function view_mail_logs() { global $ir,$c,$h,$userid; $_GET['st']=abs((int) $_GET['st']); $rpp=100; print "<h3>Mail Logs</h3> <table width=75% border=2> \n<tr style='background:gray'> <th>ID</th> <th>Time</th> <th>User From</th> <th>User To</th> <th width>Subj</th> <th width=30%>Msg</th> <th></th> </tr>"; $q=mysql_query("SELECT m.*,u1.username as sender, u2.username as sent FROM mail m LEFT JOIN users u1 ON m.mail_from=u1.userid LEFT JOIN users u2 ON m.mail_to=u2.userid WHERE m.mail_from != 0 ORDER BY m.mail_time DESC LIMIT {$_GET['st']},$rpp",$c) or die(mysql_error()." "."SELECT cx.*,u1.username as sender, u2.username as sent FROM cashxferlogs cx LEFT JOIN users u1 ON cx.cxFROM=u1.userid LEFT JOIN users u2 ON cx.cxTO=u2.userid ORDER BY cx.cxTIME DESC LIMIT {$_GET['st']},$rpp"); while($r=mysql_fetch_array($q)) { print "\n<tr><td>{$r['mail_id']}</td> <td>" . date("F j, Y, g:i:s a",$r['mail_time']) . "</td><td>{$r['sender']} [{$r['mail_from']}] </td> <td>{$r['sent']} [{$r['mail_to']}] </td> \n<td> {$r['mail_subject']}</td> \n<td>{$r['mail_text']}</td> <td> [[url='admin.php?action=mailform&XID={$r[']MailBan Sender[/url]] [[url='admin.php?action=mailform&XID={$r[']MailBan Receiver[/url]]</td> </tr>"; } print "</table> "; $q2=mysql_query("SELECT mail_id FROM mail WHERE mail_from != 0",$c); $rs=mysql_num_rows($q2); $pages=ceil($rs/20); print "Pages: "; for($i=1;$i<=$pages;$i++) { $st=($i-1)*20; print "[url='admin.php?action=maillogs&st=$st']$i[/url]"; if($i % 7 == 0) { print " \n"; } } }   Replace with print "<h3>Mail Logs</h3> <table width=75% border=2> \n<tr style='background:gray'> <th>ID</th> <th>Time</th> <th>User From</th> <th>User To</th> <th width>Subj</th> <th width=30%>Msg</th> <th></th> </tr>"; $q=mysql_query("SELECT m.*,u1.username as sender, u2.username as sent FROM mailall m LEFT JOIN users u1 ON m.mail_from=u1.userid LEFT JOIN users u2 ON m.mail_to=u2.userid WHERE m.mail_from != 0 ORDER BY m.mail_time DESC LIMIT {$_GET['st']},$rpp",$c) or die(mysql_error()." "."SELECT cx.*,u1.username as sender, u2.username as sent FROM cashxferlogs cx LEFT JOIN users u1 ON cx.cxFROM=u1.userid LEFT JOIN users u2 ON cx.cxTO=u2.userid ORDER BY cx.cxTIME DESC LIMIT {$_GET['st']},$rpp"); while($r=mysql_fetch_array($q)) { print "\n<tr><td>{$r['mail_id']}</td> <td>" . date("F j, Y, g:i:s a",$r['mail_time']) . "</td><td>{$r['sender']} [{$r['mail_from']}] </td> <td>{$r['sent']} [{$r['mail_to']}] </td> \n<td> {$r['mail_subject']}</td> \n<td>{$r['mail_text']}</td> <td> [[url='admin.php?action=mailform&XID={$r[']MailBan Sender[/url]] [[url='admin.php?action=mailform&XID={$r[']MailBan Receiver[/url]]</td> </tr>"; } print "</table> "; $q2=mysql_query("SELECT mail_id FROM mail WHERE mail_from != 0",$c); $rs=mysql_num_rows($q2); $pages=ceil($rs/20); print "Pages: "; for($i=1;$i<=$pages;$i++) { $st=($i-1)*20; print "[url='admin.php?action=maillogs&st=$st']$i[/url]"; if($i % 7 == 0) { print " \n"; } } }     Go to PhpMyAdmin and add the SQL [mysql] CREATE TABLE `mailall` ( `mail_id` int(11) NOT NULL auto_increment, `mail_read` int(11) NOT NULL default '0', `mail_from` int(11) NOT NULL default '0', `mail_to` int(11) NOT NULL default '0', `mail_time` int(11) NOT NULL default '0', `mail_subject` varchar(255) NOT NULL default '', `mail_text` text NOT NULL, PRIMARY KEY (`mail_id`) ) ENGINE=MyISAM AUTO_INCREMENT=1 [/mysql] Thanks Brad
  8. Yeah i was just about to type though lol but his game lol so his mistake
  9. What do you mean?
  10. Dam jordan beat me to it
  11. I like the idear. Nice mod
  12. Nice work there. Simple but effective.
  13. Thank you but i didn't think of that when i was coding it
  14. It's been a while since i made a mod so i done one. All i have done is made a simple change to the shops to show an item pic. This is only for mccodes lite but you could covert.   Replace shops.php with this. <?php /* MCCodes Lite shops.php Rev 1.0.0 Copyright (C) 2006 Dabomstew This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 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']); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm); $h->menuarea(); $_GET['shop'] = abs((int) $_GET['shop']); if(!$_GET['shop']) { print "You begin looking through town and you see a few shops. "; $q=mysql_query("SELECT * FROM shops WHERE shopLOCATION={$ir['location']}",$c); print "<table width=85%><tr style='background: gray;'><th>Shop</th><th>Description</th></tr>"; while($r=mysql_fetch_array($q)) { print "<tr><td>[url='shops.php?shop={$r[']{$r['shopNAME']}[/url]</td><td>{$r['shopDESCRIPTION']}</td></tr>"; } print "</table>"; } else { $sd=mysql_query("SELECT * FROM shops WHERE shopID={$_GET['shop']}",$c); if(mysql_num_rows($sd)) { $shopdata=mysql_fetch_array($sd); if($shopdata['shopLOCATION'] == $ir['location']) { print "Browsing items at [b]{$shopdata['shopNAME']}...[/b] <table><tr style='background: gray;'><th>Item</th><th>Item Name</th><th>Price</th><th>Sell Price</th><th>Buy</th></tr>"; $qtwo=mysql_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",$c) or die(mysql_error()); $lt=""; while($r=mysql_fetch_array($qtwo)) { if($lt!=$r['itmtypename']) { $lt=$r['itmtypename']; print "\n<tr style='background: gray;'><th colspan=5>{$lt}</th></tr>"; } print "\n<tr><td>[img={$r[]</td></td> <td>{$r['itmname']}</td><td>\${$r['itmbuyprice']}</td><td>\${$r['itmsellprice']}</td><td><form action='itembuy.php?ID={$r['itmid']}' method='post'>Qty: <input type='text' name='qty' value='1' /><input type='submit' value='Buy' /></form></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(); ?>     Add in PhpMyAdmin [mysql]ALTER TABLE `items` ADD `itmpic` TEXT NOT NULL[/mysql] If you use the create item tool you will have to add the item pic add but i would just use PhpMyAdmin.
  15. Brad

    Arcade

    Cool kk
×
×
  • Create New...