se7enet purgatorio

Page 1 of 1 1
Topic Options
Rate This Topic
#17749 - 07/03/08 03:24 PM cheats
EAL
Grape Nuts


Registered: 07/03/08
Posts: 31

Offline
I have been working for hours trying to get cheats in my game. When I play I get no errors but it doesn't work. The cheat code however does not show in the babblebox. That gave me the idea that there is something wrong with the sql statment. here is the code :

elseif ($safecontent == "give me money" || $safecontent == "give me money"){
$update = doquery("UPDATE {{table}} SET gold='.$userrow[gold]. + 100'", "users");
}

i also tried:

elseif ($safecontent == "give me money" || $safecontent == "give me money"){

doquery("UPDATE {{table}} SET gold='gold + 100'", "users");
}


This is what it looks like in the source:

function babblebox() {




global $userrow;

if (isset($_POST["babble"])) {
$safecontent = makesafe($_POST["babble"]);
$textsmilies = array(":p", ":)", ":(", ";)", "-.-");
$imagesmilies = array("<img src=\"images/smilies/tongue.gif\">", "<img src=\"images/smilies/smile.gif\">", "<img src=\"images/smilies/frown.gif\">", "<img src=\"images/smilies/wink.gif\">", "<img src=\"images/smilies/mm.gif\">");


$safecontent = str_replace($textsmilies, $imagesmilies, $safecontent);
if ($safecontent == "" || $safecontent == " ") { //blank post. do nothing.
}
elseif ($safecontent == "give me money" || $safecontent == "give me money"){

$update = doquery("UPDATE {{table}} SET gold='.$userrow[gold]. + 100'", "users");
}



else { $insert = doquery("INSERT INTO {{table}} SET id='',posttime=NOW(),author='".$userrow["charname"]."',babble='$safecontent'", "babble"); }
header("Location: index.php?do=babblebox");
die();
}

$babblebox = array("content"=>"");
$bg = 1;
$babblequery = doquery("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 20", "babble");
while ($babblerow = mysql_fetch_array($babblequery)) {
if ($bg == 1) { $new = "<div style=\"width:98%; background-color:#eeeeee;\">[<b>".$babblerow["author"]."</b>] ".$babblerow["babble"]."</div>\n"; $bg = 2; }
else { $new = "<div style=\"width:98%; background-color:#ffffff;\">[<b>".$babblerow["author"]."</b>] ".stripslashes($babblerow["babble"])."</div>\n"; $bg = 1; }
$babblebox["content"] = $new . $babblebox["content"];
}
$babblebox["content"] .= "<center><form action=\"index.php?do=babblebox\" method=\"post\"><input type=\"text\" name=\"babble\" size=\"15\" maxlength=\"120\" /><br /><input type=\"submit\" name=\"submit\" value=\"Babble\" /> <input type=\"reset\" name=\"reset\" value=\"Clear\" /></form></center>";

// Make page tags for XHTML validation.
$xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
. "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n"
. "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
$page = $xml . gettemplate("babblebox");
echo parsetemplate($page, $babblebox);
die();

}

Please help if can can


Edited by EAL (07/03/08 03:31 PM)

Top
#17750 - 07/03/08 06:07 PM Re: cheats [Re: EAL]
Fayt
Crunchberries
***

Registered: 11/08/05
Posts: 1131
Loc: My Computer, USA

Offline
Cheat codes are insanely enter. Store it in the database, player types in a code, check if it works or not. Bingo
_________________________
MasterFayt - Amara 5 - Manas - Banar

Top
Page 1 of 1 1


Hop to:

se7enet

Barack Obama Logo