Проблем с скрипта

crazzybg

Registered
<?php
ob_start();
session_start();
$username = $_SESSION['member_username'];
$password = $_SESSION['member_password'];
$character = $_SESSION['character'];
include("./config.php");
include("../inc/sqlcfg.php");
secure($_POST['username']);
secure($_POST['password']);
secure($_POST['character']);
$md5 = mssql_query("SELECT * FROM misc WHERE id=4");
$md5 = mssql_fetch_array($md5);
$md5 = $md5['misc'];
if($md5 == 1)
{
$check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd=[dbo].[fn_md5]('$password','$username')");
}
else
{
$check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd='$password'");
}
function level_reset() {
{
$char = secure($_POST['chars']);
$char = str_replace("'" , "", $char);
$char = str_replace(";" , "", $char);
$resmoney = '30000000';
$reslevel = '350';
$maxres = '100';
$respoints = '400';
$ConnectStatt = '1';

global $web;
$hero = mssql_query("SELECT * FROM Character WHERE Name='$char'");
$row = mssql_fetch_array($hero);
$acccc = $row['AccountID'];
$online_check = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$acccc'");
$onlinecheck = mssql_fetch_array($online_check);
if (empty($char)) { echo "<td><br><font size=2>Please select Character!</font><br><br></td>"; $error=1; }
elseif ($onlinecheck['ConnectStat'] == $ConnectStatt){ echo "<td><br><font size=2>Account is online, must be logged off!</font><br><br></td>"; $error=1; }
elseif ($row['Money'] < $resmoney) { echo "<td><br><font size=2><b>$char</b> need [<b>$resmoney</b>] zen to Reset!</font><br><br></td>"; $error=1; }
elseif ($row['cLevel'] < $reslevel){ echo "<td><br><font size=2><b>$char</b> need level [<b>$reslevel</b>] to Reset!</font><br><br></td>"; $error=1; }
elseif ($row['Resets'] >= $maxres) { echo "<td><br><font size=2>You have reach maximum resets! Cannot reset this hero!</font><br><br></td>"; $error=1; }
if($error !=1) {
$resetup = $row['Resets'] + (1);
$money = $row['Money'] - $resmoney;
$reset_points = "UPDATE character SET [LevelUpPoint]='$respoints',[Money]='$money',cLevel='1',[Strength]='25',[Dexterity]='25',[Vitality]='25',[Energy]='25',Experience='0',[MapNumber]='0',[MapPosX]='125',[MapPosY]='128',[Resets]='$resetup',[inventory]=CONVERT(varbinary(1080), null),[magiclist]= CONVERT(varbinary(180), null) WHERE Name='$char'";
$reset_results = mssql_query($reset_points);
echo "<td><br><font size=2><b>$char</b> has been reset!</font><br><br></td>";
}
}
}
?>



$reset_points = "UPDATE character SET [LevelUpPoint]='$respoints',[Money]='$money',cLevel='1',[Strength]='25',[Dexterity]='25',[Vitality]='25',[Energy]='25',Experience='0',[MapNumber]='0',[MapPosX]='125',[MapPosY]='128',[Resets]='$resetup',[inventory]=CONVERT(varbinary(1080), null),[magiclist]= CONVERT(varbinary(180), null) WHERE Name='$char'";

2 рия скрипт съм го отделил да се вижда какъв ми е точно проблема а горе е общо всичко. та проблема ми е следния.
Когато единя герой ресне го стартира с 400 точки ( така съм записал от горе) и информацията отива в датабазата и се вижда че той се е реснал
1 път как мога да го извартя да е примерно ако е реснал 3 път то да стане
400 х 3 и да му даде 1200 а не само 400 точки ?
ако някой неме е разбрал и проявява интерес да ми помогне ще се пробвам да го кажа дума по дума от начало.

Благодаря предварително на тези които ще ми помогнат.[/code]
 
PHP:
<?php
ob_start();
session_start();
$username = $_SESSION['member_username'];
$password = $_SESSION['member_password'];
$character = $_SESSION['character'];
include("./config.php");
include("../inc/sqlcfg.php");
secure($_POST['username']);
secure($_POST['password']);
secure($_POST['character']);
$md5 = mssql_query("SELECT * FROM misc WHERE id=4");
$md5 = mssql_fetch_array($md5);
$md5 = $md5['misc'];
if($md5 == 1)
{
$check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd=[dbo].[fn_md5]('$password','$username')");
}
else
{
$check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd='$password'");
}
function level_reset() {
{
$char = secure($_POST['chars']);
$char = str_replace("'" , "", $char);
$char = str_replace(";" , "", $char);
$resmoney = '30000000';
$reslevel = '350';
$maxres = '100';
$respoint = '400';
$ConnectStatt = '1';

global $web;
$hero = mssql_query("SELECT * FROM Character WHERE Name='$char'");
$row = mssql_fetch_array($hero);
$acccc = $row['AccountID'];
$online_check = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$acccc'");
$onlinecheck = mssql_fetch_array($online_check);
if (empty($char)) { echo "<td><br><font size=2>Please select Character!</font><br><br></td>"; $error=1; }
elseif ($onlinecheck['ConnectStat'] == $ConnectStatt){ echo "<td><br><font size=2>Account is online, must be logged off!</font><br><br></td>"; $error=1; }
elseif ($row['Money'] < $resmoney) { echo "<td><br><font size=2><b>$char</b> need [<b>$resmoney</b>] zen to Reset!</font><br><br></td>"; $error=1; }
elseif ($row['cLevel'] < $reslevel){ echo "<td><br><font size=2><b>$char</b> need level [<b>$reslevel</b>] to Reset!</font><br><br></td>"; $error=1; }
elseif ($row['Resets'] >= $maxres) { echo "<td><br><font size=2>You have reach maximum resets! Cannot reset this hero!</font><br><br></td>"; $error=1; }
if($error !=1) {
$resetup = $row['Resets'] + (1);
$money = $row['Money'] - $resmoney;
$respoints = $row['Resets'] * $respoint + $respoint;
$reset_points = "UPDATE character SET [LevelUpPoint]='$respoints',[Money]='$money',cLevel='1',[Strength]='25',[Dexterity]='25',[Vitality]='25',[Energy]='25',Experience='0',[MapNumber]='0',[MapPosX]='125',[MapPosY]='128',[Resets]='$resetup',[inventory]=CONVERT(varbinary(1080), null),[magiclist]= CONVERT(varbinary(180), null) WHERE Name='$char'";
$reset_results = mssql_query($reset_points);
echo "<td><br><font size=2><b>$char</b> has been reset!</font><br><br></td>";
}
}
}
?>
Ето ти скрипта ;)

Дай линк към сайта ти на лично да го видя.
 

Горе