-
Posts
572 -
Joined
-
Last visited
-
Days Won
7
Content Type
Profiles
Forums
Events
Everything posted by NonStopCoding
-
[Code Name] Meh, [The Project] A new Text Game Engine
NonStopCoding replied to Sim's topic in Game Projects
make new deadline ;) -
ok so i assume your v2 is older version ok then snikos way would be the way for you :P add the code to the file you wish to see errors on ini_set('display_errors', 1); error_reporting(E_ALL); might want to read this so you understand a little more http://php.net/manual/en/function.ini-set.php http://php.net/manual/en/function.error-reporting.php
-
Your register.php is already using the insert id so look for $i=$db->insert_id(); $db->query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10, 5)"); below the insert into userstats add (You can go with the send event or send pm) event_add($i, 'Welcome to my game etc'); or as sniko used in his first post $db->query("INSERT INTO `mail` (`mail_read`,`mail_from`,`mail_to`,`mail_time`,`ma il_subject`,`mail_text`) VALUES (0, 1, ". $i .", unix_timestamp(), 'Welcome to the game', 'This is a message from the admins! Yay.')");
-
ok looking further into the code i believe your issue is this travelingglobals.php die("<p style='color: red;font-weight: bold;font-size: 2' />You are travelling for {$ir['traveltime']} minutes. Please wait until you arrive at your destination to access this page.</font> <center> <a href="http://index.php" target="_blank">Go Home</a> </center>"); replace with die("<p style='color: red;font-weight: bold;font-size: 2' />You are travelling for {$ir['traveltime']} minutes. Please wait until you arrive at your destination to access this page.</font> <center> <a href='index.php'>Go Home</a> </center>"); also if you turn on error reporting you are going to find things like A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined index: action (8) Line executed: /home/nonstopc/public_html/mcc/club.php:22 a simple fix would be if(!isset($_GET['action'])) $_GET['action'] = ''; above the switch($_GET['action']) EDIT AGAIN: So i quickly installed the module onto my test site and went to a club spent about $6,000 did a dare and make like $20,000 profit. Basically what i am trying to say is edit the payouts etc before you put it live as it could cause inflation on your game
-
lol look at your chat mod i think mwg went crazy waiting on release haha
-
yea or that way :P custom one ?? hmm sure i guess people would be interested when are they not interested in your work ;)
-
which version of mccodes are you using? EDIT: dunno about older versions of mccodes but in v2.05b you can go to lib/basic_error_handler.php and find this define('DEBUG', false); set it to true to turn on error reporting
-
turn error reporting on and it should show the error? also this mod is using up to 5 new fields in the users table which already has enough in it me personally i would of used a new table for it but that's just my 2 cents EDIT: from looking at clubbing the code is messed up look for stuff that don't look right for example <h3/>text</h3> <a href='filename' />text</a> there should only be a open and close <h3>This is a header 3</h3> <a href='index.php'>This is a link to take you home</a> i only got down about 20 lines but could be more issues causing blank screen
-
the code is a mess but i managed to find line 45 print "<tr><td>{$r['carNAME']} </td> <td>Lv{$r['cpcACCLV']} ($acc)</td> <td>Lv{$r['cpcHANLV']} ($han)</td> <td>Lv{$r['cpcSPDLV']} ($spd)</td> <td>Lv{$r['cpcSHDLV']} ($shd)</td><td>$challenge</td> </td> </tr>"; as someone said can't remember who but you have a extra </td> change that link to print "<tr><td>{$r['carNAME']} </td> <td>Lv{$r['cpcACCLV']} ($acc)</td> <td>Lv{$r['cpcHANLV']} ($han)</td> <td>Lv{$r['cpcSPDLV']} ($spd)</td> <td>Lv{$r['cpcSHDLV']} ($shd)</td><td>$challenge</td> <td style='color:green;'><a href='tune.php'>Tune</a></td> </tr>";
-
Please provide screenshots
-
looks like the only issue to me
-
I have decided to release this module for free can leaders can purchase a city and set a tax value 0-15% of there crime earnings Gang leader will see who is owe them money from a log in the gang options and be able to claim it aswell once that's done it adds it to the gangs vault SQL ALTER TABLE `cities` ADD `gowner` int(11) NOT NULL DEFAULT '0', ADD `gtax` int(2) NOT NULL DEFAULT '0'; INSERT INTO `settings` (`conf_id`, `conf_name`, `conf_value`) VALUES (NULL, 'citycost', '1000000'); Open explore.php and find if ($ir['jail'] > 0 || $ir['hospital'] > 0) { die("This page cannot be accessed while in jail or hospital."); } below this line add $gowner = $db->query("SELECT `gowner`,`gtax` FROM `cities` WHERE `cityid` = {$ir['location']} AND `gowner` = 0"); if($db->num_rows($gowner)) { if($ir['gang'] > 0) $gl = $db->query("SELECT `gangID`,`gangPRESIDENT`,`gangRESPECT` FROM `gangs` WHERE `gangPRESIDENT` = {$ir['userid']}"); if($db->num_rows($gl)) { $gang = $db->fetch_row($gl); $cost = (($set['citycost'] / 1.5) + (($set['citycost'] / 4.8) * $gang['gangRESPECT']) * 0.20); echo " <span style='color:red;font-weight:bold;'> This city has not been taken over.<br /><a href='explore.php?buy'>[buy City for <span style=color:green;'> ".money_formatter($cost)."</span>]</a> </span><br /><br />"; if(isset($_GET['buy'])) { if($ir['money'] < $cost) echo "You don't have enough money you need ".money_formatter($cost - $ir['money'])." more.<br /><br />"; else if($ir['userid'] != $gang['gangPRESIDENT']) echo "Sorry but only gang presidents can do this.<br /><br />"; else { $db->query("UPDATE `cities` SET `gowner` = {$gang['gangID']} WHERE `cityid` = {$ir['location']} AND `gowner` = 0"); $db->query("UPDATE `users` SET `money` = `money` - {$cost} WHERE `userid` = {$gang['gangPRESIDENT']}"); echo "You have purchased this city since there is no owner you can now set tax in the staff side of your gang.<br /><br />"; } } } } else { $gowner = $db->query("SELECT `gowner`,`gtax` FROM `cities` WHERE `cityid` = {$ir['location']}"); $gang = $db->fetch_row($gowner); $gangname = $db->fetch_single($db->query("SELECT `gangNAME` FROM `gangs` WHERE `gangID` = {$gang['gowner']}")); echo "{$gangname} Owns this city and has a tax value of {$gang['gtax']}% of your earnings..<br /><br />"; } open up yourgang.php and find function gang_staff() { global $db, $ir, $c, $userid, $gangdata, $h; if ($gangdata['gangPRESIDENT'] == $userid || $gangdata['gangVICEPRES'] == $userid) { if (!isset($_GET['act2'])) { $_GET['act2'] = 'idx'; } switch ($_GET['act2']) { in the switch statements add 2 new cases case "tax": gang_staff_settax(); break; case "payments": gang_staff_payments(); break; now find function gang_staff_idx() and replace it with this function or edit in if you need to function gang_staff_idx() { global $db, $ir, $c, $userid, $gangdata; echo " <b>General</b> <br /> <a href='yourgang.php?action=staff&act2=vault'>Vault Management</a> <br /> <a href='yourgang.php?action=staff&act2=apps'>Application Management</a> <br /> <a href='yourgang.php?action=staff&act2=vicepres'>Change Vice-President</a> <br /> <a href='yourgang.php?action=staff&act2=upgrade'>Upgrade Gang</a> <br /> <a href='yourgang.php?action=staff&act2=crimes'>Organised Crimes</a> <br /> <a href='yourgang.php?action=staff&act2=masspayment'>Mass Payment</a> <br /> <a href='yourgang.php?action=staff&act2=ament'>Change Gang Announcement</a> <br /> "; if($gangdata['gangPRESIDENT'] == $userid) { echo " <hr /> <a href='yourgang.php?action=staff&act2=pres'>Change President</a><br /> <a href='yourgang.php?action=staff&act2=declare'>Declare War</a><br /> <a href='yourgang.php?action=staff&act2=surrender'>Surrender</a><br /> <a href='yourgang.php?action=staff&act2=viewsurrenders'>View or Accept Surrenders</a><br /> <a href='yourgang.php?action=staff&act2=massmailer'>Mass Mail Gang</a><br /> <a href='yourgang.php?action=staff&act2=name'>Change Gang Name</a><br /> <a href='yourgang.php?action=staff&act2=desc'>Change Gang Desc.</a><br /> <a href='yourgang.php?action=staff&act2=tag'>Change Gang Tag</a><br />"; $check_city = $db->query("SELECT `gowner` FROM `cities` WHERE `gowner` = {$gangdata['gangID']} AND `cityid` = {$ir['location']}"); if($db->num_rows($check_city)) { echo " <a href='yourgang.php?action=staff&act2=tax'>Change City Tax</a><br /> <a href='yourgang.php?action=staff&act2=payments'>Check Tax Payment</a>"; } } below that function add these two functions function gang_staff_settax() { global $db,$ir,$gangdata,$h,$set; if($ir['userid'] != $gangdata['gangPRESIDENT']) { echo "You are not permitted to be here.."; $h->endpage(); exit; } $check_city = $db->query("SELECT `gtax` FROM `cities` WHERE `gowner` = {$gangdata['gangID']} AND `cityid` = {$ir['location']}"); if(!$db->num_rows($check_city)) { echo "You don't own this city.."; $h->endpage(); exit; } $tax = array( '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15' ); if(isset($_POST['set_tax'])) { $_POST['gID'] = isset($_POST['gID']) && ctype_digit($_POST['gID']) ? abs(intval($_POST['gID'])) : 0; $_POST['tax'] = isset($_POST['tax']) && ctype_digit($_POST['tax']) && in_array($_POST['tax'], $tax) ? $_POST['tax'] : ''; if(empty($_POST['gID']) || empty($_POST['tax'])) echo "You have missed a required field.."; else { $check = $db->query("SELECT `gtax` FROM `cities` WHERE `gowner` = {$_POST['gID']} AND `cityid` = {$ir['location']}"); if($db->fetch_single($check) == $_POST['tax']) echo "You'r tax is already set to this so nothing changed.."; else { $cityname = $db->fetch_single($db->query("SELECT `cityname` FROM `cities` WHERE `cityid` = {$ir['location']}")); $db->query("UPDATE `cities` SET `gtax` = '{$_POST['tax']}' WHERE `gowner` = {$_POST['gID']} AND `cityid` = {$ir['location']}"); echo "You have updated the tax to ".$_POST['tax']."% for {$cityname}"; } } } else { echo "<h3>City Tax Amount</h3> <form method='post'> <input type='hidden' name='gID' value='{$gangdata['gangID']}' /> <select name='tax' type='dropdown'>"; foreach($tax as $t) printf("<option value='%1\$s'>%1\$s</option>", $t); echo " </select>%<br /><br /> <input type='submit' name='set_tax' value='Set Tax' /> </form><hr width='75%'> <h3>Get Your Taxes</h3> <a href='yourgang.php?action=staff&act2=payments'>[Check Profit]</a>"; } } function gang_staff_payments() { global $db,$ir,$gangdata,$h,$set; if($ir['userid'] != $gangdata['gangPRESIDENT']) { echo "You are not permitted to be here.."; $h->endpage(); exit; } if(isset($_GET['collect'])) { $_GET['collect'] = isset($_GET['collect']) && ctype_digit($_GET['collect']) ? abs(intval($_GET['collect'])) : 0; if(empty($_GET['collect'])) { echo "You have missed a required field."; $h->endpage(); exit; } $select = $db->query("SELECT * FROM `citypayments` WHERE `id` = {$_GET['collect']}"); if(!$db->num_rows($select)) { echo "not real."; $h->endpage(); exit; } $s = $db->fetch_row($select); if($gangdata['gangPRESIDENT'] != $ir['userid']) { echo "You can't claim this money.."; $h->endpage(); exit; } if(!$ir['gang']) { echo "Are you lost?.."; $h->endpage(); exit; } $db->query("UPDATE `gangs` SET `gangMONEY` = `gangMONEY` + {$s['earnings']} WHERE `gangPRESIDENT` = {$ir['userid']}"); echo "You have collected ".money_formatter($s['earnings']); $db->query("DELETE FROM `citypayments` WHERE `cowner` = {$gangdata['gangPRESIDENT']}"); } else { echo "<h3>Your Profits</h3>"; $profits = $db->query("SELECT * FROM `citypayments` WHERE `cowner` = {$gangdata['gangID']}"); if(!$db->num_rows($profits)) echo "You have no Profits.."; else { echo " <table width='75%' class='table' style='text-align:center;'> <tr> <th>User</th> <th>City</th> <th>Earnings</th> <th>Gang</th> <th>Action</th> </tr>"; while($tax = $db->fetch_row($profits)) { $un = $db->fetch_single($db->query("SELECT `username` FROM `users` WHERE `userid` = {$tax['userid']}")); $cn = $db->fetch_single($db->query("SELECT `cityname` FROM `cities` WHERE `cityid` = {$tax['cityid']}")); if($tax['gang'] > 0) $gname = $db->fetch_single($db->query("SELECT `gangNAME` FROM `gangs` WHERE `gangID` = {$tax['gang']}")); else $gname = "No Gang"; echo " <tr> <td>{$un}</td> <td>{$cn}</td> <td>".money_formatter($tax['earnings'])."</td> <td>{$gname}</td> <td><a href='yourgang.php?action=staff&act2=payments&collect={$tax['id']}'>Collect Profits</td> </tr>"; } echo "</table>"; $total = $db->query("SELECT SUM(IF(`earnings` > 0, `earnings`,0)) AS `total` FROM `citypayments` WHERE `cowner` = {$gangdata['gangID']}"); $t = $db->fetch_row($total); echo "<br /><br />You have made ".money_formatter($t['total']); } } } Replace docrime.php with this if its not been edited <?php /** * MCCodes Version 2.0.5b * Copyright (C) 2005-2012 Dabomstew * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: docrime.php * Signature: 427d116f8a7253197c4364dd543771e6 * Date: Fri, 20 Apr 12 08:50:30 +0000 */ $_GET['c'] = isset($_GET['c']) && ctype_digit($_GET['c']) ? abs(intval($_GET['c'])) : 0; $macropage = "docrime.php?c={$_GET['c']}"; require_once('globals.php'); if($ir['jail'] > 0 || $ir['hospital'] > 0) die($h->endpage("This page cannot be accessed while in jail or hospital.")); if($_GET['c'] <= 0) echo "Invalid crime"; else { $q = $db->query("SELECT * FROM `crimes` WHERE `crimeID` = {$_GET['c']} LIMIT 1"); if($db->num_rows($q) == 0) { echo 'Invalid crime.'; $h->endpage(); exit; } $r = $db->fetch_row($q); $db->free_result($q); if($ir['brave'] < $r['crimeBRAVE']) echo "You do not have enough Brave to perform this crime."; else { $ec ="\$sucrate=". str_replace( array("LEVEL", "CRIMEXP", "EXP", "WILL", "IQ"), array($ir['level'], $ir['crimexp'],$ir['exp'], $ir['will'], $ir['IQ']),$r['crimePERCFORM']) . ";"; eval($ec); print $r['crimeITEXT']; $ir['brave'] -= $r['crimeBRAVE']; $db->query("UPDATE `users` SET `brave` = {$ir['brave']} WHERE `userid` = $userid"); if(rand(1, 100) <= $sucrate) { $taxes = $db->query("SELECT `gtax`,`gowner` FROM `cities` WHERE `cityid` = {$ir['location']} AND `gowner` > 0"); if($db->num_rows($taxes)) { $tax = $db->fetch_row($taxes); if($ir['gang'] != $tax['gowner']) { $citycheck = $db->query("SELECT * FROM `citypayments` WHERE `userid` = {$ir['userid']} AND `cowner` = {$tax['gowner']}"); if(!$db->num_rows($citycheck)) { $earn = $r['crimeSUCCESSMUNY'] / 100 * $tax['gtax']; print str_replace("{money}", $r['crimeSUCCESSMUNY'],$r['crimeSTEXT']); echo "<br /><strong>You have been charged a {$tax['gtax']}% of your income from crime.<br /> If you have a item as a reward the tax will be taken from the item sell price.<br /> You made ".money_formatter($r['crimeSUCCESSMUNY'] - $earn); $ir['money'] += $r['crimeSUCCESSMUNY']; $ir['money'] -= $earn; $ir['crystals'] += $r['crimeSUCCESSCRYS']; $ir['exp'] += (int) ($r['crimeSUCCESSMUNY'] / 8); $db->query("INSERT INTO `citypayments` VALUES(NULL,{$ir['location']},{$ir['userid']},{$earn},{$ir['gang']},{$tax['gowner']})"); $db->query("UPDATE `users` SET `money` = {$ir['money']}, `crystals` = {$ir['crystals']}, `exp` = {$ir['exp']}, `crimexp` = `crimexp` + {$r['crimeXP']} WHERE `userid` = $userid", $c); if($r['crimeSUCCESSITEM']) { $itmcost = $db->query("SELECT `itmsellprice` FROM `items` WHERE `itmid` = {$r['crimeSUCCESSITEM']}"); $itm = $db->fetch_row($itmcost); $ip = $r['crimeSUCCESSITEM'] / 100 * $tax['gtax']; $db->query("INSERT INTO `citypayments` VALUES(NULL,{$ir['location']},{$ir['userid']},{$ip},{$ir['gang']},{$tax['gowner']})"); item_add($userid, $r['crimeSUCCESSITEM'], 1); } } else { $earn = $r['crimeSUCCESSMUNY'] / 100 * $tax['gtax']; print str_replace("{money}", $r['crimeSUCCESSMUNY'],$r['crimeSTEXT']); echo "<br /><strong>You have been charged a {$tax['gtax']}% of your income from crime.<br /> If you have a item as a reward the tax will be taken from the item sell price.<br /> You made ".money_formatter($r['crimeSUCCESSMUNY'] - $earn); $ir['money'] += $r['crimeSUCCESSMUNY']; $ir['money'] -= $earn; $ir['crystals'] += $r['crimeSUCCESSCRYS']; $ir['exp'] += (int) ($r['crimeSUCCESSMUNY'] / 8); $db->query("UPDATE `citypayments` SET `earnings` = `earnings` + {$earn} WHERE `userid` = {$ir['userid']} AND `cowner` = {$tax['gowner']}"); $db->query("UPDATE `users` SET `money` = {$ir['money']}, `crystals` = {$ir['crystals']}, `exp` = {$ir['exp']}, `crimexp` = `crimexp` + {$r['crimeXP']} WHERE `userid` = $userid", $c); if($r['crimeSUCCESSITEM']) { $itmcost = $db->query("SELECT `itmsellprice` FROM `items` WHERE `itmid` = {$r['crimeSUCCESSITEM']}"); $itm = $db->fetch_row($itmcost); $ip = $r['crimeSUCCESSITEM'] / 100 * $tax['gtax']; $db->query("INSERT INTO `citypayments` VALUES(NULL,{$ir['location']},{$ir['userid']},{$ip},{$ir['gang']},{$tax['gowner']})"); item_add($userid, $r['crimeSUCCESSITEM'], 1); } } } else { $earn = $r['crimeSUCCESSMUNY'] / 100 * $tax['gtax']; print str_replace("{money}", $r['crimeSUCCESSMUNY'],$r['crimeSTEXT']); $ir['money'] += $r['crimeSUCCESSMUNY']; $ir['crystals'] += $r['crimeSUCCESSCRYS']; $ir['exp'] += (int) ($r['crimeSUCCESSMUNY'] / 8); $db->query("UPDATE `users` SET `money` = {$ir['money']}, `crystals` = {$ir['crystals']}, `exp` = {$ir['exp']}, `crimexp` = `crimexp` + {$r['crimeXP']} WHERE `userid` = $userid", $c); if($r['crimeSUCCESSITEM']) { $itmcost = $db->query("SELECT `itmsellprice` FROM `items` WHERE `itmid` = {$r['crimeSUCCESSITEM']}"); $itm = $db->fetch_row($itmcost); $ip = $itm['itmsellprice'] / 100 * $tax['gtax']; $db->query("UPDATE `citypayments` SET `earnings` = `earnings` + {$ip} WHERE `userid` = {$ir['userid']} AND `cityid` = {$ir['location']} AND `cowner` = {$tax['gowner']}"); item_add($userid, $r['crimeSUCCESSITEM'], 1); } } } } else { if (rand(1, 2) == 1) { print $r['crimeFTEXT']; } else { print $r['crimeJTEXT']; $db->query( "UPDATE `users` SET `jail` = '{$r['crimeJAILTIME']}', `jail_reason` = '{$r['crimeJREASON']}' WHERE `userid` = $userid"); } } echo "<br /><a href='docrime.php?c={$_GET['c']}'>Try Again</a><br /> <a href='criminal.php'>Crimes</a>"; } } $h->endpage();
-
your template reminds me of http://www.vilecity.com and nice mod :D
-
haha i never even noticed the age of topic
-
i have a similar problem but its doing it with skype not ie so i know how you feel
-
its nice chat if can think of any good additions ill post :p
-
could be useful for people who can't code and pagination on the logs for each checking of pages. Just a few ideas :)
-
how easy is it to check text logs make sure non rules are being broken as i guess people will have that for there chat just another question to throw out there ? :p [MENTION=69001]Zettieee[/MENTION] [MENTION=53425]Magictallguy[/MENTION]
-
mccode-v2 Track Players' Actions - The Easy Way
NonStopCoding replied to TheMasterGeneral's topic in Free Modifications
will release mine later when i am home if it will any help to you -
I have used ravens in the part when i first started out and was like wow this is cool easy setup and its full of mods anyways get to the point yea it is a older version of mccodes v2 (insecure from attacks) i also heard that the layout itself was a stolen layout slapped on the mccodes engine changed things about and sells copies of it. If you have a valid mccodesv2 license then you will be fine but my personal opinion is your better off with the new mccodes v2.05b than ravens 1. v2.05b is more secure than ravens 2. v2.05b is more optimized than ravens (meaning it wont each up nearly as much "Resources" as ravens will) 3. Ravens is packed full of "Paid Modules" which i belive would be stealling if you use them without paying for them. Edit: If i remember right i think i got to 10-20 members on a shared hosting (yea i know its crap) before the game started going to hell and hosting contacting me you would need to fork out for a good vps or dedi to run that peice of crap script
-
Ok so been doing some work on this and managed to get some stuff done * Added new fields to cities table * Added a new staff file which is only available if you own 1 or more cities also only shows to gang presidents (money is paid by hand). with this new option you will be able to set a tax value of 1-15% which will be taken from users who are in your city so if they do a crime your tax amount is taken off and added into the gang vault (Thinking of adding a option to pay or not if not then your gang can take action against him.) That's pretty much what i have done and got planned
-
i like the idea never worked with mccodes gangs before so should be interesting
-
i could try what you got in mind? i always get stuck on ideas for what to code :)
-
delete the first 2 lines after <?php and add require_once('globals_nonauth.php'); if ($argc == 2) { if ($argv[1] != $_CONFIG['code']) { exit; } } else if (!isset($_GET['code']) || $_GET['code'] !== $_CONFIG['code']) { exit; } see if that helps that from the latest version of mccodes i believe this mod was coded for the older version of mccodes
-
np :p