...

View Full Version : need help!!!



cheat
11-17-2006, 06:00 AM
hey i need help with a few scripts for my game... this is the mercs.php
the game is a koc clone i only have 3 pages left to fix and this is one of them plz help!!!

<?
include "vsys.php";
if ($cgi['buy_merc']){
$merc=getCommonInfo();
$wal=max($wal,0);

if ($cgi['mercs_attack']){
if ($cgi['mercs_attack']>$merc->attackSpecCount)$cgi['mercs_attack']=$merc->attackSpecCount;
$gold=$cgi['mercs_attack']*$conf["mercenaries"]["atack"]["prise"];
$user=getUserDetails($_SESSION['isLogined']," gold ");
$wal=max($wal,0);
if ($user->gold>$gold){
updateMercenary(" attackSpecCount=attackSpecCount-{$cgi['mercs_attack']} ");
updateUser($_SESSION['isLogined'], " trainedAttackMerc=trainedAttackMerc+{$cgi['mercs_attack']} , gold=gold-$gold ");
$wal=max($wal,0);
}else{
$strErr="You do not have enough money";
}
}
if ($cgi['mercs_defend']){
if ($cgi['mercs_defend']>$merc->defSpecCount)$cgi['mercs_defend']=$merc->defSpecCount;
$gold=$cgi['mercs_defend']*$conf["mercenaries"]["defence"]["prise"];
$user=getUserDetails($_SESSION['isLogined']," gold ");
$wal=max($wal,0);
if ($user->gold>$gold){
updateMercenary(" defSpecCount =defSpecCount -{$cgi['mercs_defend']} ");
updateUser($_SESSION['isLogined'], " trainedDefMerc=trainedDefMerc+{$cgi['mercs_defend']} , gold=gold-$gold ");
$wal=max($wal,0);
}else{
$strErr="You do not have enough money";
}
}
if ($cgi['mercs_general']){
if ($cgi['mercs_general']>$merc->untrainedCount)$cgi['mercs_general']=$merc->untrainedCount;
$gold=$cgi['mercs_general']*$conf["mercenaries"]["untrained"]["prise"];
$user=getUserDetails($_SESSION['isLogined']," gold ");
$wal=max($wal,0);
if ($user->gold>$gold){
updateMercenary(" untrainedCount =untrainedCount -{$cgi['mercs_general']} ");
updateUser($_SESSION['isLogined'], " untrainedMerc=untrainedMerc+{$cgi['mercs_general']} , gold=gold-$gold ");
$wal=max($wal,0);
}else{
$strErr="You do not have enough money";
}
}
header("Location: mercs.php?strErr=$strErr");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0037)http://www.warriorsoftime.com/mercs.php -->
<HTML><HEAD><TITLE>Warriors of Time :: Massively Multiplayer Online Role Playing Game</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><!-- ZoneLabs Privacy Insertion -->
<SCRIPT language=javascript src="js/js"></SCRIPT>
<LINK href="css/common.css" type=text/css rel=stylesheet><LINK
href="css/Elves.css" type=text/css rel=stylesheet>
<META
content="warriorsoftime, chaos, elves, humans, dwarves, orcs, rpg, mmorpg, role playing, game, online game, text based game, armory, mercenaries, spy, attack, army, battle, recruit, spies, spy skill, weapons, messaging, sabotage, recon, intelligence, pnp, mud, games, stockade, free, browser game"
name=keywords>
<META
content="Warriors of Time is a Massively Multiplayer Online Role Playing Game with over 500,000 players. Players can choose one of four races: Orcs, Humans, Elves and Dwarves and build armies, recruit friends as officers, buy weapons, and spy and attack on each other."
name=description>
<META content="Warriors of Time" name=author>
<SCRIPT language=javascript type=text/javascript>
<!--
function checkCR(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
}
document.onkeypress = checkCR;
//-->
</SCRIPT>

<META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
<BODY text=#ffffff bgColor=#000000 leftMargin=0 topMargin=0 marginheight="0"
marginwidth="0">
<?
include "top.php";
?>

<TABLE cellSpacing=0 cellPadding=5 width="100%" border=0>
<TBODY>
<TR>
<TD class=menu_cell style="PADDING-LEFT: 15px" vAlign=top width=140>
<?
include ("left.php");
?>

</TD>
<TD style="PADDING-RIGHT: 15px; PADDING-LEFT: 15px; PADDING-TOP: 12px"
vAlign=top align=left> <? if ($cgi['strErr']){ echo "<center><font color=red>{$cgi['strErr']}</font></center>"; } ?><BR>
<H3>Mercenaries</H3>
<TABLE class=table_lines cellSpacing=0 cellPadding=6 width="380"
border=0>
<TBODY>
<TR>
<TH colSpan=2>Personnel</TH>
</TR>
<TR>
<TD><B>Trained Attack Soldiers</B></TD>
<TD align=right>
<? numecho ($user->trainedAttackSold) ?>
</TD>
</TR>
<TR>
<TD><B>Trained Attack Mercenaries</B></TD>
<TD align=right>
<? numecho ($user->trainedAttackMerc) ?>
</TD>
</TR>
<TR>
<TD><B>Trained Defense Soldiers</B></TD>
<TD align=right>
<? numecho ($user->trainedDefSold)?>
</TD>
</TR>
<TR>
<TD><B>Trained Defense Mercenaries</B></TD>
<TD align=right>
<? numecho ($user->trainedDefMerc) ?>
</TD>
</TR>
<TR>
<TD><B>Untrained Soldiers</B></TD>
<TD align=right>
<? numecho ($user->untrainedSold) ?>
</TD>
</TR>
<TR>
<TD><B>Untrained Mercenaries</B></TD>
<TD align=right>
<? numecho ($user->untrainedMerc) ?>
</TD>
</TR>
<TR>
<TD class=subh><B>Spies</B></TD>
<TD class=subh align=right>
<? numecho ($user->spies) ?>
</TD>
</TR>
<TR>
<TD><B>Total Fighting Force</B></TD>
<TD align=right>
<? numecho (getTotalFightingForce($user))?>
</TD>
</TR>
</TBODY>
</TABLE>
<P>
<?
$merc=getCommonInfo();
?>
<FORM action=mercs.php method=post>
<TABLE class=table_lines cellSpacing=0 cellPadding=6 width="100%"
border=0>
<TBODY>
<TR>
<TH align=middle colSpan=4>Buy Mercenaries</TH></TR>
<TR>
<TH class=subh align=left>Mercenary Type</TH>
<TH class=subh align=right>Cost Per Unit</TH>
<TH class=subh align=right>Quantity Available</TH>
<TH class=subh align=middle>Quantity to Buy</TH></TR>
<TR>
<TD>Attack Specialist</TD>
<TD align=right><? numecho ($conf["mercenaries"]["atack"]["prise"]) ?> Gold</TD>
<TD align=right><? numecho ($merc->attackSpecCount);?></TD>
<TD align=middle><INPUT size=3 value=0 name=mercs_attack></TD></TR>
<TR>
<TD>Defense Specialist</TD>
<TD align=right>
<? numecho ($conf["mercenaries"]["defence"]["prise"]) ?>
Gold</TD>
<TD align=right>
<? numecho ($merc->defSpecCount );?>
</TD>
<TD align=middle><INPUT size=3 value=0 name=mercs_defend></TD></TR>
<TR>
<TD>Untrained</TD>
<TD align=right>
<? numecho ($conf["mercenaries"]["untrained"]["prise"]) ?>
Gold</TD>
<TD align=right>
<? numecho ($merc->untrainedCount );?>
</TD>
<TD align=middle><INPUT size=3 value=0 name=mercs_general></TD></TR>
<TR>
<TD align=middle colSpan=4><INPUT type=submit value=Buy>
</TD></TR></TBODY></TABLE><INPUT type=hidden
value=93aa2b6a02603399396203313b45827e name=hash>
<INPUT type=hidden value=1 name=buy_merc></FORM>
<?
include ("bottom.php");
?>
</TD></TR></TBODY></TABLE>
</BODY></HTML>

CFMaBiSmAd
02-10-2007, 11:25 PM
Just reviewing your threads to see if there is some common thread (pun intended) to the problems you are experiencing.

No one responded to this thread because you didn't state what the problem is, what the symptoms are, or what you need help with on it. You only posted a ton of code (not properly wrapped in [ php ] tags so as to be harder than normal to read) and said "plz help!!!"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum