[Help] Точки при рестарт

123321123321

New Member
Joined
May 11, 2010
Messages
10
Reaction score
0
Моля ако някой може да удари 1 рамо немога да си наглася то4ките на рестарт за мг/бк/см/елф ....

Това ми е кода ... и немога да го наглася ......
Ами трябва спешно :)))

function reset_character()
{
global $resetmoney;
global $resettype;
global $resetpoints;
global $resetclearinv;
global $resetclearskill;
global $maxresets;
global $resetlevel;

$character = secure($_POST['character']);
$account = secure($_POST['login']);
$password = secure($_POST['password']);

check_inject();

$query = mssql_query("Select clevel,resets,money,leveluppoint from Character where Name='$character'");
$row = mssql_fetch_row($query);

$newmoney = $row[2]-$resetmoney;
$newresets = $row[1] + 1;

if($row[1] >= 1) { $newpoints = $row[1] * $resetpoints; }

$newleveluppoints = $row[3] + $resetpoints;

$queryaccount = mssql_query("Select * from MEMB_INFO where memb___id='$account'");
$accountcheck = mssql_num_rows($queryaccount);

$queryonline = mssql_query("Select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$onlinecheck = mssql_num_rows($queryonline);

$querypassword = mssql_query("Select * from MEMB_INFO where memb___id='$account' and memb__pwd='$password'");
$passwordcheck = mssql_num_rows($querypassword);

$querychar = mssql_query("Select * from Character where Name='$character'");
$charcheck = mssql_num_rows($querychar);

if(empty($character) or empty($account) or empty($password)) { echo"<font color='red'>You cannot leave any fields blank!</font><br>"; $error=1; }
elseif($accountcheck <= 0) { echo"<font color='red'>Your Login does not exist in our database. Please go back and try again!</font><br>"; $error=1; }
elseif($passwordcheck <= 0) { echo"<font color='red'>Your Password does not exist in our database. Please go back and try again!</font><br>"; $error=1; }
elseif($charcheck <= 0) { echo"<font color='red'>Your Character does not exist in our database. Please go back and try again!</font><br>"; $error=1; }
else
{
if($newmoney < 0) { echo"<font color='red'>Character $character dones not have enough money to reset!</font><br>"; $error=1;}
if($row[0] < $resetlevel) { echo"<font color='red'>Character $character must be $resetlevel in order to reset!</font><br>"; $error=1;}
if($newresets > $maxresets) { echo"<font color='red'>Character $character is maximum resets!</font><br>"; $error=1;}
if($onlinecheck >= 1) { echo"<font color='red'>Account $account is online!Please LogOff First!</font><br>"; $error=1;}

if($error != 1)
{
echo"<font color='green'>Character $character has been succesfully restarted.</font><br>";

if($resettype == keep)
{
$a = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets' where name='$character'");
}
elseif($resettype == bonus)
{
$a = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'");
}
elseif($resettype == reset)
{
$a = mssql_query("Update Character Set Strength='25',Dexterity='25',Vitality='25',Energy='25',LeaderShip='25',Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'");
}
if($resetclearinv == yes) { $b = mssql_query("UPDATE Character set Inventory=CONVERT(varbinary(1080), null) WHERE Name='$character'"); }
if($resetclearskill == yes) { $c = mssql_query("Update Character set magiclist= CONVERT(varbinary(60), null) WHERE Name='$character'"); }
}
}
}


function vote()
{
global $votecredits;
global $votelink;
global $votehours;

$account = secure($_POST['login']);
check_inject();

$time = 60 * 60 * $votehours;
$timenow = time();
$time2 = $timenow - $time;

$queryaccount = mssql_query("Select * from MEMB_INFO where memb___id='$account'");
$accountcheck = mssql_num_rows($queryaccount);

$queryvote = mssql_query("Select * from votereward where time>'$time2' and memb___id='$account'");
$votecheck = mssql_num_rows($queryvote);

if(empty($account)) { echo"<font color='red'>You cannot leave any fields blank!</font><br>"; $error=1; }
elseif($accountcheck <= 0) { echo"<font color='red'>Your Login does not exist in our database. Please go back and try again!</font><br>"; $error=1; }
elseif($votecheck >= 1) { echo"<font color='red'>You can vote once on every $votehours hours!</font><br>"; $error=1; }

if($error != 1) {
$a = mssql_query("INSERT INTO votereward (memb___id, time ) VALUES('$account','$timenow')");
$b = mssql_query("Update MEMB_CREDITS set credits = credits+$votecredits WHERE memb___id='$account'");

echo"<font color='green'>You have succsesfully voted!</font>";
echo"<meta http-equiv=\"refresh\" content=\"0;url=$votelink\" />";
}
}

function level_reset() {
if ((isset($_SESSION['pass'])) && (isset($_SESSION['user']))); {

$login = secure($_SESSION['user']);
$char = secure($_POST['chars']);
$character = secure($_POST['character']);
$account = secure($_POST['login']);
$password = secure($_POST['password']);
global $resetmoney;
global $resettype;
global $resetpoints;
global $resetclearinv;
global $resetclearskill;
global $resetlimit;
global $resetlevel;
global $resetmoneytype;
$username_check = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='$account'");
$username_checked = mssql_num_rows($username_check);
$name_check = mssql_query("SELECT Name FROM Character WHERE Name='$character' and AccountID ='$account'");
$name_checked = mssql_num_rows($name_check);
$online_check = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$account'");
$online_checked = mssql_fetch_array($online_check);
$result = mssql_query("SELECT * FROM Character WHERE Name='$char'");
$row = mssql_fetch_array($result);
$inv = substr(bin2hex($row['Inventory']),0,240);
$newinv = str_pad('',240,'f');

if($resetmoneytype == 0) { $resetmoney = $resetmoney * ($row['Resets']+1); }
elseif($resetmoneytype == 1) { $resetmoney = $resetmoney; }
$money = $row['Money'] - $resetmoney;
$resetup = $row['Resets'] + (1);
if (empty($char)) { echo "<table class='tmem' width='350' border='0' cellpadding='0' cellspacing='0' align='center'><tr><td class='left'>Please Select Character!</td></tr></table><br />"; $error=1; }
elseif ($online_checked['ConnectStat'] != 0){ echo "<table class='tmem' width='350' border='0' cellpadding='0' cellspacing='0' align='center'><tr><td class='left'>Account is online, must be logged off!</td></tr></table><br />"; $error=1; }
elseif ($money < 0) { echo "<table class='tmem' width='350' border='0' cellpadding='0' cellspacing='0' align='center'><tr><td class='left'><font color='#5b9f91'>$char </font> need <font color='#5b9f91'>$resetmoney</font> zen to reset!</td></tr></table><br />"; $error=1; }
elseif ($row['cLevel'] < $resetlevel){ echo "<table class='tmem' width='350' border='0' cellpadding='0' cellspacing='0' align='center'><tr><td class='left'><font color='#5b9f91'>$char</font> need level <font color='#5b9f91'>$resetlevel</font> to reset!</td></tr></table><br />"; $error=1; }
elseif ($row['Resets'] >= $resetlimit) { echo "<table class='tmem' width='350' border='0' cellpadding='0' cellspacing='0' align='center'><tr><td class='left'>You have reach maximum resets! Cannot reset this hero!</td></tr></table><br />"; $error=1; }
elseif($resetclearinv == 1){
if($inv != $newinv) { echo "<table class='tmem' width='350' border='0' cellpadding='0' cellspacing='0' align='center'><tr><td class='left'>Your inventory is not empty! Please remove all items!</td></tr></table><br />"; $error=1; }
}
if ($error !=1) {
if($resettype == 0){
$update = "UPDATE Character SET [cLevel]='1',[Experience]='0',[Money]='$money',[Resets]='$resetup' WHERE Name='$char'"; }
elseif($resettype == resetstats){
$update = "Update Character Set [Strength]='25',[Dexterity]='25',[Vitality]='25',[Energy]='25',[Money]='$money',[clevel]='1',[Experience]='0',[Resets]='$resetup',[LevelUpPoint]='$resetpoints' where name='$char'"; }
elseif($resettype == 1){
$bonus = $resetpoints * ($row['Resets']+(1));
$update = "UPDATE Character SET [Strength]='25',[Dexterity]='25',[Vitality]='25',[Energy]='25',[cLevel]='1',[Experience]='0',[LevelUpPoint]='$bonus',[Money]='$money',[Resets]='$resetup' WHERE Name='$char'"; }
elseif($resettype == 2){
$bonus = $resetpoints * ($row['Resets']+(1));
$update = "UPDATE Character SET [cLevel]='1',[Experience]='0',[LevelUpPoint]='$bonus',[Money]='$money',[Resets]='$resetup' WHERE Name='$char'"; }
$result_res = mssql_query($update);
if($resetclearinv == 1) { $clean_inv = "UPDATE Character set [Inventory]=CONVERT(varbinary(1080), null) WHERE Name='$char'"; }
if($resetclearskill == 1) { $clean_skill = "UPDATE Character set [Inventory]=CONVERT(varbinary(1080), null) WHERE Name='$char'"; }
$result_inv = mssql_query($clean_inv);
$result_skill = mssql_query($clean_skill);
echo "<table class='ranktable' width='350' border='0' cellpadding='0' cellspacing='0' align='center'><tr><td class='left'><font color='#5b9f91'>$char</font> successfully reseted!</td></tr></table><br />";
}
}
}