Имам проблем със дарксвеба някои ако може да каже как да оправя бъга при ресетите да проверява като ресваш дали героя е онлине.
това е reset_character.php
А това е clear_reset_do.php
това е reset_character.php
Code:
<tr>
<td colspan='6'><center><b>Y</b>our <b>C</b>haracter's <b>I</b>nformation</font></b></center></td>
</tr>
<table class='news-head' align='center' border='0' cellpadding='0' cellspacing='0' >
<tr align='center'>
</tr>
<?php
ob_start();
session_start();
include("config.php");
$account_id = stripslashes($_SESSION['member_username']);
$account_id = clean_var($account_id);
$character = mssql_query("SELECT * FROM accountcharacter WHERE ID='$account_id'");
$char = mssql_fetch_array($character);
$rank_query = mssql_query("Select Name,LevelUpPoint,Strength,Dexterity,Vitality,Energy,Leadership,Class,cLevel,Resets,PkCount,PkLevel,MaxLife,MaxMana,Class,Money FROM Character WHERE AccountID='$account_id'");
for($i=0;$i < mssql_num_rows($rank_query);++$i)
{
$v=$i+1;
$row = mssql_fetch_row($rank_query);
$status = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$username'");
$status = mssql_fetch_array($status);
$status = $status['ConnectStat'];
if($status == "1")
{
$status = "<img src=images/Online.gif> <img src=images/Online11.gif>";
}
else
{
$status = "<img src=images/Offline.gif> <img src=images/Offline1.gif>";
}
//Class
if ($row['7'] == 0) { $row[7] = "Dark Wizard"; }
if ($row['7'] == 1) { $row[7] = "Soul Master"; }
if ($row['7'] == 2) { $row[7] = "Grand Master"; }
if ($row['7'] == 16) { $row[7] = "Dark Knight"; }
if ($row['7'] == 17) { $row[7] = "Blade Knight"; }
if ($row['7'] == 18) { $row[7] = "Blade Master"; }
if ($row['7'] == 19) { $row[7] = "Blade Master"; }
if ($row['7'] == 32) { $row[7] = "Elf"; }
if ($row['7'] == 33) { $row[7] = "Muse Elf"; }
if ($row['7'] == 34) { $row[7] = "High Elf"; }
if ($row['7'] == 48) { $row[7] = "Magic Gladiator"; }
if ($row['7'] == 49) { $row[7] = "Duel Master"; }
if ($row['7'] == 64) { $row[7] = "Dark Lord"; }
if ($row['7'] == 65) { $row[7] = "Lord Emperor"; }
if ($row['7'] == 80) { $row[7] = "Summoner"; }
if ($row['7'] == 81) { $row[7] = "Bloody Summoner"; }
if ($row['7'] == 82) { $row[7] = "Dimension Master"; }
if ($row['7'] == 83) { $row[7] = "Dimension Master"; }
//PK Level
if($row[11] == 1){ $row[11] ='<font color=#605ca8>Hero';}
if($row[11] == 2){ $row[11] ='<font color=#abcef8>Commoner';}
if($row[11] == 3){ $row[11] ='Normal';}
if($row[11] == 4){ $row[11] ='<font color=#fbaf5d>Against Murderer';}
if($row[11] == 5){ $row[11] ='<font color=#a0410d>Murderer';}
if($row[11] == 6){ $row[11] ='<font color=#c81118>Phonomania';}
//Class Pic
if($row['14'] == 0){ $pic ="<img src=images/dw.jpg width=100 height=119>"; }
if($row['14'] == 1){ $pic ="<img src=images/dw.jpg width=100 height=119>"; }
if($row['14'] == 2){ $pic ="<img src=images/dw.jpg width=100 height=119>"; }
if($row['14'] == 16){ $pic ='<img src=images/dk.jpg width=100 height=119>'; }
if($row['14'] == 17){ $pic ='<img src=images/dk.jpg width=100 height=119>'; }
if($row['14'] == 18){ $pic ='<img src=images/dk.jpg width=100 height=119>'; }
if($row['14'] == 19){ $pic ='<img src=images/dk.jpg width=100 height=119>'; }
if($row['14'] == 32){ $pic ='<img src=images/elf.jpg width=100 height=119>'; }
if($row['14'] == 33){ $pic ='<img src=images/elf.jpg width=100 height=119>'; }
if($row['14'] == 34){ $pic ='<img src=images/elf.jpg width=100 height=119>'; }
if($row['14'] == 48){ $pic ='<img src=images/mg.jpg width=100 height=119>'; }
if($row['14'] == 49){ $pic ='<img src=images/mg.jpg width=100 height=119>'; }
if($row['14'] == 64){ $pic ='<img src=images/dl.jpg width=100 height=119>'; }
if($row['14'] == 65){ $pic ='<img src=images/dl.jpg width=100 height=119>'; }
if($row['14'] == 80){ $pic ='<img src=images/sum.jpg width=100 height=119>'; }
if($row['14'] == 81){ $pic ='<img src=images/sum.jpg width=100 height=119>'; }
if($row['14'] == 82){ $pic ='<img src=images/sum.jpg width=100 height=119>'; }
if($row['14'] == 83){ $pic ='<img src=images/sum.jpg width=100 height=119>'; }
echo "
<td class='news-rest' align='center'>
<a class='helpLink' onmouseover=\"overlib('<table class=sort-table width=400 border=0 cellspacing=0 cellpadding=0 align=left><tbody><br><tr><td rowspan=19 align=center>$pic<br><b>$row[0]</b><br><font size=1>$row[9] reset(s)/$row[8] Level</font><br><font size=1>($row[7])</font></td></tr><tr><td colspan=2><span class=rankings_text>Level Up Point:</span></td><td><span class=rankings_text>$row[1]</span></td></tr><tr><td colspan=2><span class=rankings_text>Strenght:</span></td><td><span class=rankings_text>$row[2]</span></td></tr><tr class=even><td colspan=2><span class=rankings_text>Agility:</span></td><td><span class=rankings_text>$row[3]</span></td></tr><tr><td colspan=2><span class=rankings_text>Vitality:</span></td><td><span class=rankings_text>$row[4]</span></td></tr><tr class=even><td colspan=2><span class=rankings_text>Energy:</span></td><td><span class=rankings_text>$row[5]</span></td></tr><tr><td colspan=2><span class=rankings_text>Command:</span></td><td><span class=rankings_text>$row[6]</span></td></tr><tr class=even><td colspan=2><span class=rankings_text>Money:</span></td><td><span class=rankings_text>$row[15]</span></td></tr><tr class=even><td colspan=2><span class=rankings_text>Total Kills:</span></td><td><span class=rankings_text>$row[10]</span></td></tr><tr><td colspan=2><span class=rankings_text>Pk Level:</span></td><td><span class=rankings_text>$row[11]</span></td></tr><tr class=even><td colspan=2><span class=rankings_text>Status:</span></td><td>$status</td></tr></tbody></table>' ,false); return false\" onmouseout=\"return nd();\"><center><font color='#DDA943'>$pic<a/></a><br><center>$row[0]</center>
";
}
?>
</div><tr>
<table class='news-rest' align='center' border='0' cellpadding='0' cellspacing='0' >
<?php
ob_start();
session_start();
include("config.php");
include("clear_reset_do.php");
$account_id = secure($_SESSION['member_username']);
$account_id = clean_var($account_id);
$character = mssql_query("SELECT * FROM accountcharacter WHERE ID='$account_id'");
$char = mssql_fetch_array($character);
if (isset($_POST["level_reset"])) {level_reset();}
?>
<form action="" method="post">
<tr>
<td><center>Choose hero:
<?
echo("<select name='chars' id='chars' class='buttons'>
<option class='formae' value='$char[GameID1]'>$char[GameID1]</option>
<option class='formae' value='$char[GameID2]'>$char[GameID2]</option>
<option class='formae' value='$char[GameID3]'>$char[GameID3]</option>
<option class='formae' value='$char[GameID4]'>$char[GameID4]</option>
<option class='formae' value='$char[GameID5]'>$char[GameID5]</option></select>"); ?><td><input type="submit" value="Reset Char" class="buttons" name="level_reset" id="level_reset"></td>
</form>
</tr></table><br><br>
А това е clear_reset_do.php
Code:
<?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 = '1000000000';
$reslevel = '400';
$maxres = '999';
$respoints = '500';
global $web;
$username_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID = '$username'");
$username_checked = mssql_num_rows($username_check);
$online_check = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$username'");
$online_checked = mssql_fetch_array($online_check);
$hero = mssql_query("SELECT * FROM Character WHERE Name='$char'");
$row = mssql_fetch_array($hero);
if (empty($char)) { echo "<td><br><font size=2>Please select Character!</font><br><br></td>"; $error=1; }
elseif ($online_checked['ConnectStat'] != 0){ 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) {
$newstats = $row['LevelUpPoint'] + $respoints;
$resetup = $row['Resets'] + (1);
$money = $row['Money'] - $resmoney;
$reset_points = "UPDATE character SET [LevelUpPoint]='$newstats',[Money]='$money',[MapNumber]='0',[MapPosX]='125',[MapPosY]='128',[Resets]='$resetup' WHERE Name='$char'";
$reset_results = mssql_query($reset_points);
echo "<td><br><font size=2><b>$char</b> have [<b>$newstats</b>] level up points!</font><br><br></td>";
}
}
}
?>[code]