newguy
Well-Known Member
- Joined
- Nov 23, 2008
- Messages
- 644
- Reaction score
- 572
Кое е по-голямо? Ако е второто то е нормално да ти показва такава грешка. Смени отново 100 000 000 с 1ца.ПОказва ги но пак става
На второто дава
Кое е по-голямо? Ако е второто то е нормално да ти показва такава грешка. Смени отново 100 000 000 с 1ца.ПОказва ги но пак става
На второто дава
(xaxa) (xaxa) (xaxa) (xaxa) (xaxa) (xaxa)
Първо ми кажи каде ти е това $character и каде видя в memb___id да пише името на героя?
Поправих си го Wow и с $character се обърках тъй като наи отгоре на скипрта има някаква $_SESSION['character']... и не се смеи защото като гледам и ти не си го направил както трябва
Абе exten не пиши бе човек излагаш се каде видя да пише името на героя в memb___id и да казваш, че при едни е memb___id а при други AccounID (xaxa)
имах предвид таблицата ConenctStat обърках се отново
А ти каде виждаш някаде в сктиптовете да се опоменава таблица ConenctStat?
Опа аз пак сам тъпия xDxDxDxD Обърках се отново hahahahaha не не повече по добре нищо да не пиша да ставам още поиче за срам xD
(xaxa) (xaxa) (xaxa) (xaxa) (xaxa) радвам се, че се усети най-накрая (xaxa)
понеже тук се опитваме да:
"доколкото знам 1-во се проверява дали дадения акаунт е Online"
ем еи сега ще напиша пълен скрипт начи 1-во кажи дали беше така да не ставам още поиче за срам xDxD
1.Проверка дали дадения акаунт е онлине
2.Проверка ако дадения акаунт е онлине от AccountCharacter да вземем GameIDC
3.Проверка дали $char = GameIDC
така би тряяло да стани нали
<?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 = '25000000';
$reslevel = '400';
$maxres = '2000';
$respoints = '100';
global $web;
$q= mssql_query("SELECT TOP 25 Name,AccountID from Character order by Resets desc");
$row1 = mssql_fetch_row($q);
$acc = stripslashes($_SESSION['member_username']);
$username_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID = '$acc'");
$username_checked = mssql_num_rows($username_check);
$online_check = mssql_query("SELECT * from MEBM_STAT where memb___id='$acc' and ConnectStat=1");
$online_checked = mssql_num_rows($online_check);
if($online_checked == 1)
{
$username_query = mssql_query("Select GameIDC From AccountCharacter where Id='$acc'");
$username2 = mssql_fetch_row($username_query);
}
$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 ($username2[0] == $char){ 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',Experience='0',[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> has been reset!</font><br><br></td>";
}
}
}
?>
PHP:<?php ob_start(); session_start(); [COLOR="Red"][B]$username = $_SESSION['member_username'];[/B][/COLOR] $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 = '25000000'; $reslevel = '400'; $maxres = '2000'; $respoints = '100'; global $web; $q= mssql_query("SELECT TOP 25 Name,AccountID from Character order by Resets desc"); $row1 = mssql_fetch_row($q); [COLOR="Red"][B]$acc = stripslashes($_SESSION['member_username']);[/B][/COLOR] $username_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID = '$acc'"); $username_checked = mssql_num_rows($username_check); $online_check = mssql_query("SELECT * from MEBM_STAT where memb___id='$acc' and [COLOR="Red"][B]ConnectStat=1[/B][/COLOR]"); $online_checked = mssql_num_rows($online_check); [B][COLOR="Red"]if($online_checked == 1) { $username_query = mssql_query("Select GameIDC From AccountCharacter where Id='$acc'"); $username = mssql_fetch_row($username_query); }[/COLOR][/B] $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 ([COLOR="Red"][B]$username[0] == $char[/B][/COLOR]){ 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',Experience='0',[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> has been reset!</font><br><br></td>"; } } } ?>
Някои желаещ да тества xD
ауу не сам видялГрешен ти е кода и имаш 2 пъти $username и 2 пъти проверяваш сесията.
Пак ти е грешен и няма да работи
<?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 = '100000000';
$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 ConnectStat FROM MEMB_STAT WHERE memb___id='$acc' AND ConnectStat='0'");
$online_check = mssql_num_rows($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_check <= 0)
echo " Account '.$acc.' Is Online!";
<br><br>
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 = $respoints * ($row['Resets']) ;
$resetup = $row['Resets'] + (1);
$money = $row['Money'] - $resmoney;
$reset_points = "UPDATE [MuOnline].[dbo].[Character] SET [cLevel]='1',[Experience]='0',[LevelUpPoint]=' +100',[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>";
}
}
}
?>
Стоне вземи така скрипт-а да видим дали ще има проблеми