Scorpio Posted May 23, 2013 Posted May 23, 2013 Atttack Lost V2 (Latest Update) Dose not work. MCCodes team fix it :P Quote
Bennyh789 Posted May 24, 2013 Posted May 24, 2013 Atttack Lost V2 (Latest Update) Dose not work. MCCodes team fix it :P What doesn't 'work' on it? Quote
Dominion Posted May 24, 2013 Posted May 24, 2013 What doesn't 'work' on it? ^ This. Post up the file, and any errors you have or contact mccodes via their website. I would suggest the former. Quote
sniko Posted May 24, 2013 Posted May 24, 2013 ^ This. Post up the file, and any errors you have or contact mccodes via their website. I would suggest the former. Due to my current affiliation with McCodes, I'll take this :) Post the code, plus all relevant details regarding to it not working. Quote
Scorpio Posted May 24, 2013 Author Posted May 24, 2013 (edited) Error - MCCodes - Critical Error A critical error has occurred, and this page cannot be displayed. Please try again later. Query failed attacklost.php - <?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: attacklost.php * Signature: 95b6a74ae7c7a6cf4e9ed998f3b574c8 * Date: Fri, 20 Apr 12 08:50:30 +0000 */ $atkpage = 1; require_once('globals.php'); $_GET['ID'] = (isset($_GET['ID']) && is_numeric($_GET['ID'])) ? abs((int) $_GET['ID']) : 0; $_SESSION['attacking'] = 0; $_SESSION['attacklost'] = 0; $od = $db->query( "SELECT `username`, `level`, `gang` FROM `users` WHERE `userid` = {$_GET['ID']}"); if ($db->num_rows($od) > 0) { $r = $db->fetch_row($od); $db->free_result($od); echo "You lost to {$r['username']}"; $expgain = abs(($ir['level'] - $r['level']) ^ 3); $expgainp = $expgain / $ir['exp_needed'] * 100; echo " and lost $expgainp% EXP!"; // Figure out their EXP, 0 or decreased? $newexp = max($ir['exp'] - $expgain, 0); $db->query( "UPDATE `users` SET `exp` = {$newexp}, `attacking` = 0 WHERE `userid` = $userid"); event_add($r['userid'], "<a href='viewuser.php?u=$userid'>{$ir['username']}</a> attacked you and lost.", $c); $atklog = $db->escape($_SESSION['attacklog']); $db->query( "INSERT INTO `attacklogs` VALUES(NULL, $userid, {$_GET['ID']}, 'lost', " . time() . ", 0, '$atklog')"); if ($ir['gang'] > 0 && $r['gang'] > 0) { $warq = $db->query( "SELECT * FROM `gangwars` WHERE (`warDECLARER` = {$ir['gang']} AND `warDECLARED` = {$r['gang']}) OR (`warDECLARED` = {$ir['gang']} AND `warDECLARER` = {$r['gang']})"); if ($db->num_rows($warq) > 0) { $war = $db->fetch_row($warq); $db->query( "UPDATE `gangs` SET `gangRESPECT` = `gangRESPECT` + 1 WHERE `gangID` = {$r['gang']}"); $db->query( "UPDATE `gangs` SET `gangRESPECT` = `gangRESPECT` - 1 WHERE `gangID` = {$ir['gang']}"); echo "<br />You lost 1 respect for your gang!"; } $db->free_result($warq); } } else { $db->free_result($od); echo "You lost to Mr. Non-existant! =O"; } $h->endpage(); I then Installed it on a Wamp sever. I still get the same error. (I didnt change nothing) And its the latest one from the mccodes place. Edited May 24, 2013 by Scorpio Quote
sniko Posted May 25, 2013 Posted May 25, 2013 Hi, Sorry for my inactivity, I've been busy with work (just heading out to work, again - split shifts) I shall be online tomorrow (Sunday) night, and I should have a patch to push to you :) -sniko Quote
Magictallguy Posted May 25, 2013 Posted May 25, 2013 Try this <?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: attacklost.php ** Signature: 95b6a74ae7c7a6cf4e9ed998f3b574c8 ** Date: Fri, 20 Apr 12 08:50:30 +0000 **/ $atkpage = 1; require_once('globals.php'); $_GET['ID'] = (isset($_GET['ID']) && ctype_digit($_GET['ID'])) ? abs((int) $_GET['ID']) : 0; $_SESSION['attacking'] = 0; $_SESSION['attacklost'] = 0; if(!$_GET['ID']) { echo "You didn't specify a player to attack"; exit($h->endpage()); } $od = $db->query("SELECT `username`, `level`, `gang` FROM `users` WHERE `userid` = {$_GET['ID']}"); if(!$db->num_rows($od)) { echo "You lost to Mr. Non-Existant!"; exit($h->endpage()); } $r = $db->fetch_row($od); $db->free_result($od); echo "You lost to ", stripslashes(htmlspecialchars($r['username'])); $expgain = abs(($ir['level'] - $r['level']) ^ 3); $expgainp = $expgain / $ir['exp_needed'] * 100; echo " and lost ", number_format($expgainp, 2), "% EXP!"; // Figure out their EXP, 0 or decreased? $newexp = max($ir['exp'] - $expgain, 0); $db->query("UPDATE `users` SET `exp` = {$newexp}, `attacking` = 0 WHERE `userid` = $userid"); event_add($r['userid'], "<a href='viewuser.php?u=$userid'>{$ir['username']}</a> attacked you and lost.", $c); $atklog = $db->escape($_SESSION['attacklog']); $db->query("INSERT INTO `attacklogs` VALUES(NULL, $userid, {$_GET['ID']}, 'lost', " . time() . ", 0, '$atklog')"); if($ir['gang'] > 0 && $r['gang'] > 0) { $warq = $db->query("SELECT * FROM `gangwars` " . "WHERE (((`warDECLARER` = {$ir['gang']}) AND (`warDECLARED` = {$r['gang']})) " . "OR ((`warDECLARED` = {$ir['gang']}) AND (`warDECLARER` = {$r['gang']})))"); if($db->num_rows($warq) > 0) { $war = $db->fetch_row($warq); $db->query("UPDATE `gangs` SET `gangRESPECT` = `gangRESPECT` + 1 WHERE `gangID` = {$r['gang']}"); $db->query("UPDATE `gangs` SET `gangRESPECT` = `gangRESPECT` - 1 WHERE `gangID` = {$ir['gang']}"); echo "You lost 1 respect for your gang!"; } $db->free_result($warq); } $h->endpage(); ?> Quote
Djkanna Posted May 26, 2013 Posted May 26, 2013 <?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: attacklost.php ** Signature: 95b6a74ae7c7a6cf4e9ed998f3b574c8 ** Date: Fri, 20 Apr 12 08:50:30 +0000 **/ $atkpage = 1; require_once('globals.php'); $_GET['ID'] = (isset($_GET['ID']) && ctype_digit($_GET['ID'])) ? abs((int) $_GET['ID']) : 0; $_SESSION['attacking'] = 0; $_SESSION['attacklost'] = 0; if(!$_GET['ID']) { echo "You didn't specify a player to attack"; exit($h->endpage()); } $od = $db->query("SELECT `username`, `level`, `gang` FROM `users` WHERE `userid` = {$_GET['ID']}"); if(!$db->num_rows($od)) { echo "You lost to Mr. Non-Existant!"; exit($h->endpage()); } $r = $db->fetch_row($od); $db->free_result($od); echo "You lost to ", stripslashes(htmlspecialchars($r['username'])); $expgain = abs(($ir['level'] - $r['level']) ^ 3); $expgainp = $expgain / $ir['exp_needed'] * 100; echo " and lost ", number_format($expgainp, 2), "% EXP!"; // Figure out their EXP, 0 or decreased? $newexp = max($ir['exp'] - $expgain, 0); $db->query("UPDATE `users` SET `exp` = {$newexp}, `attacking` = 0 WHERE `userid` = $userid"); event_add($_GET['ID'], "<a href='viewuser.php?u=$userid'>{$ir['username']}</a> attacked you and lost.", $c); $atklog = $db->escape($_SESSION['attacklog']); $db->query("INSERT INTO `attacklogs` VALUES(NULL, $userid, {$_GET['ID']}, 'lost', " . time() . ", 0, '$atklog')"); if($ir['gang'] > 0 && $r['gang'] > 0) { $warq = $db->query("SELECT * FROM `gangwars` " . "WHERE (((`warDECLARER` = {$ir['gang']}) AND (`warDECLARED` = {$r['gang']})) " . "OR ((`warDECLARED` = {$ir['gang']}) AND (`warDECLARER` = {$r['gang']})))"); if($db->num_rows($warq) > 0) { $war = $db->fetch_row($warq); $db->query("UPDATE `gangs` SET `gangRESPECT` = `gangRESPECT` + 1 WHERE `gangID` = {$r['gang']}"); $db->query("UPDATE `gangs` SET `gangRESPECT` = `gangRESPECT` - 1 WHERE `gangID` = {$ir['gang']}"); echo "You lost 1 respect for your gang!"; } $db->free_result($warq); } $h->endpage(); ?> (event_add() was using $r['userid'], which did not exist. ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.