Jump to content
MakeWebGames

Dabomstew

Members
  • Posts

    153
  • Joined

  • Last visited

Everything posted by Dabomstew

  1. quantify items automatically Holy crap, that adds up to 222 queries to a inventory pageload. Nice try, but a very inefficient script I wouldn't recommend unless you have a really inactive game.
  2. [Lite] Jail Nice contribution. Basic but does job.
  3. Steal Crystals when you Mug someone...   MCCodes v1.1 does not have support for big ints (> 2147483647) and as such does not have make_bigint.
  4. Profile Signatures Actually, it needs two }'s. EDIT: Ok, due to the bugginess of this, I am posting a premodded preferences.php for ya'lls. <?php /* MCCodes Lite preferences.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(); switch($_GET['action']) { case 'sexchange2': do_sex_change(); break; case 'sexchange': conf_sex_change(); break; case 'passchange2': do_pass_change(); break; case 'passchange': pass_change(); break; case 'namechange2': do_name_change(); break; case 'namechange': name_change(); break; case 'picchange2': do_pic_change(); break; case 'picchange': pic_change(); break; case 'signature2': do_signature_change(); break; case 'signature': signature_change(); break; default: prefs_home(); break; } function prefs_home() { global $ir,$c,$userid,$h; print "<h3>Preferences</h3> [url='preferences.php?action=sexchange']Sex Change[/url] [url='preferences.php?action=passchange']Password Change[/url] [url='preferences.php?action=namechange']Name Change[/url] [url='preferences.php?action=signature']Profile Signature[/url] [url='preferences.php?action=picchange']Display Pic Change[/url] "; } function conf_sex_change() { global $ir,$c,$userid,$h; if($ir['gender'] == "Male") { $g="Female"; } else { $g="Male"; } print "Are you sure you want to become a $g? [url='preferences.php?action=sexchange2']Yes[/url] | [url='preferences.php']No[/url]"; } function do_sex_change() { global $ir,$c,$userid,$h; if($ir['gender'] == "Male") { $g="Female"; } else { $g="Male"; } mysql_query("UPDATE users SET gender='$g' WHERE userid=$userid",$c); print "Success, you are now $g! [url='preferences.php']Back[/url]"; } function pass_change() { global $ir,$c,$userid,$h; print "<h3>Password Change</h3><form action='preferences.php?action=passchange2' method='post'>Current Password: <input type='password' name='oldpw' /> New Password: <input type='password' name='newpw' /> Confirm: <input type='password' name='newpw2' /> <input type='submit' value='Change PW' /></form>"; } function do_pass_change() { global $ir,$c,$userid,$h; if($_POST['oldpw'] != $ir['userpass']) { print "The current password you entered was wrong. [url='preferences.php?action=passchange']> Back[/url]"; } else if($_POST['newpw'] !== $_POST['newpw2']) { print "The new passwords you entered did not match! [url='preferences.php?action=passchange']> Back[/url]"; } else { mysql_query("UPDATE users SET userpass='{$_POST['newpw']}' WHERE userid=$userid",$c); print "Password changed!"; } } function name_change() { global $ir,$c,$userid,$h; print "<h3>Name Change</h3> Please note that you still use the same name to login, this procedure simply changes the name that is displayed. <form action='preferences.php?action=namechange2' method='post'> New Name: <input type='text' name='newname' /> <input type='submit' value='Change Name' /></form>"; } function do_name_change() { global $ir,$c,$userid,$h; if($_POST['newname'] == "") { print "You did not enter a new name. [url='preferences.php?action=namechange']> Back[/url]"; } else { $_POST['newname']=str_replace(array("<", ">", "\\\'"), array("<", ">", "'"), $_POST['newname']); mysql_query("UPDATE users SET username='{$_POST['newname']}' WHERE userid=$userid",$c); print "Username changed!"; } } function pic_change() { global $ir,$c,$userid,$h; print "<h3>Pic Change</h3> Please note that this must be externally hosted, [url='http://imageshack.us']ImageShack[/url] is our recommendation. Any images that are not 150x150 will be automatically resized <form action='preferences.php?action=picchange2' method='post'> New Pic: <input type='text' name='newpic' value='{$ir['display_pic']}' /> <input type='submit' value='Change Name' /></form>"; } function do_pic_change() { global $ir,$c,$userid,$h; if($_POST['newpic'] == "") { print "You did not enter a new pic. [url='preferences.php?action=picchange']> Back[/url]"; } else { $_POST['newpic']=str_replace('\\\'',''', $_POST['newpic']); mysql_query("UPDATE users SET display_pic='{$_POST['newpic']}' WHERE userid=$userid",$c); print "Pic changed!"; } } function signature_change() { global $ir,$c,$userid,$h; $parsesig=str_replace(" ", "\n", $ir['signature']); print "<h3>Profile Signature Change</h3> <form action='preferences.php?action=signature2' method='post'> New Profile Signature: <textarea rows=7 cols=40 name='newsignature'>{$parsesig}</textarea> <input type='submit' value='Change Profile Signature' /></form> [b]Current Profile Signature :[/b]{$ir['signature']}"; } function do_signature_change() { global $ir,$c,$userid,$h; if($_POST['newsignature'] == "") { print "You did not enter a new signature. > [url='preferences.php?action=signature']Back[/url]"; } else { $_POST['newsignature']=str_replace(array("<", ">", "\\\'","\n"), array("<", ">", "'"," "), $_POST['newsignature']); mysql_query("UPDATE users SET signature='{$_POST['newsignature']}' WHERE userid=$userid",$c); print "Profile Signature changed!"; } } $h->endpage(); ?>
  5. Profile Signatures It just needs a couple more close brackets here and there.
  6. Side Bars   % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 isnt an error, its just a standard report. Anyway, I just took v1.00b, installed it textbook, and the updating works, so something must be wrong with your config :/ http://www.mccodes.com/mclite2
  7. Side Bars I'm gonna go set up an example game to see if I can find the problem that way... hold on OK: file fixed. http://www.dabomstew.com/cron_fivemins.zip Update: missing file =O http://www.dabomstew.com/sendcash.zip
  8. Side Bars The only reply I have to that: did you remember to readd your code to the cronjobs I provided? If not, you need to, otherwise it emits a blank error, as seen by your emails you got.
  9. [Lite] Budget Streets BUDGET STREETS adapted by Dabomstew, working for Lite version: File 1: buggetstreets.php <?php //Budget streets mod //Author: on_fire //Converted for Lite by Dabomstew 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(); print "[b]You are currently searching the streets[/b] "; if ($_GET['action'] != 'explore') { print "Well. Here you are, standing in the middle of the street. Wanna take a few steps and see what you find? You have {$ir['turns']} turns left for today and will be topped up to 100 at newday. "; print " <form method=post action=buggetstreets.php?action=explore><input type=hidden name=action value=explore><input type='text' name='steps' value='{$ir['turns']}'> <input type=submit value='Explore'></form>"; } else { $steps=abs((int) $_POST['steps']); for($i=0;$i<$steps;$i++) { if ($ir['turns'] < 1) { print("You dont have enuff steps to explore the streets any more. come back at newday "); }else{ $chance = rand(1,8); mysql_query("update users set turns=turns-1 where userid=$userid",$c); if ($chance == 1) { $amnt=rand(50,200); if($ir['money'] > $amnt) { print "As you walk the streets you see a hobo he asks you for \$$amnt you tell him to piss off he smakes you over the head and takes the \$$amnt anyway. "; mysql_query("update users set money=money-{$amnt} where userid=$userid",$c); $ir['money']-=$amnt; } else { print "As you walk the streets you see a hobo he asks you for 1$ you tell him to piss off he smakes you over the head and looks in your wallet. Finding it almost empty he just runs off with it. "; mysql_query("update users set money=0 where userid=$userid",$c); $ir['money']=0; } } if ($chance == 2) { print "Nothing here. "; } if ($chance == 3) { $gained=rand(20,90)*$ir['level']; print "You found a bag of cash on the side walk you open it up and find [b]\$$gained[/b] was inside. "; mysql_query("update users set money=money+$gained where userid=$userid",$c); } if ($chance == 7) { print "You see a guy getting mugged, but you decide to keep walking. You don't want to be in his shoes anytime soon. "; } if ($chance == 4) { print "While exploring the streets you found some cash, but a hobo came quickly behind you and whacked you over the head. You lurch in suprise and the hobo takes the cash and runs off."; } if ($chance == 5) { $gain = rand(50,200)*(floor($ir['level']/2)+1); print "While searching the streets you found [b]\$$gain[/b]. "; mysql_query("update users set money=money+$gain where userid=$userid",$c); } if ($chance == 6) { $gain = rand(50,100)*(floor($ir['level']/2)+1); print "While searching the streets you found [b]\$$gain[/b]. "; mysql_query("update users set money=money+$gain where userid=$userid",$c); } if ($chance == 8) { print "Nothing here. Just a few drunk bums. "; } $ir['turns']--; print"you have [b]{$ir['turns']}[/b] steps left "; } } if($ir['turns']==0) { print "Sorry, all turns used! "; } else { print " <form method=post action=buggetstreets.php?action=explore><input type=hidden name=action value=explore><input type='text' name='steps' value='{$ir['turns']}'> <input type=submit value='Explore'></form>"; } } $h->endpage; ?> Run this sql query: ALTER TABLE users ADD turns INT(11) NOT NULL DEFAULT 100; Open: cron_day.php Find: mysql_query("DELETE FROM fedjail WHERE fed_days=0",$c); Add After: mysql_query("UPDATE users SET turns=100", $c);   You're done! Just add a link to buggetstreets.php where you like now.
  10. Side Bars The word "curl" is missing from the command. Here are correct cron Jobs: Minute 0 Hour 0 Day * Month * Weekday * Command curl http://www.astra-networks.com/rpg/cron_day.php?code= Minute */5 Hour * Day * Month * Weekday * Command curl http://www.astra-networks.com/rpg/cron_ ... .php?code=
  11. Kicking off the Lite Mods! This is the HackPC mod adjusted to work with Lite. Free mc code mod - requires no db edits - enjoy! File 1: hackpc.php File 2: hackpc.config.php Edit hackpc.config.php to change the settings. Up to you to provide the Hack PC link in a user's profile (hint: viewuser.php, Hack Users PC)
×
×
  • Create New...