- Joined
- Jan 29, 2011
- Messages
- 516
- Reaction score
- 106
Някой може ли да ми направи скрипта "doreset.php" за ресване да е:
По - 5 милиона повече за всеки рес до 99 реса, от 100- нататък да е по 500 милиона за всеки рес ? ? ?
Ето и скрипта:
По - 5 милиона повече за всеки рес до 99 реса, от 100- нататък да е по 500 милиона за всеки рес ? ? ?
Ето и скрипта:
PHP:
<?php
if ((isset($_SESSION['pass'])) && (isset($_SESSION['user'])));
{
require("config/config.php");
$charactername = stripslashes($_POST['name']);
$charactername = clean_var($charactername);
$loginid = stripslashes($_SESSION['user']);
if ((eregi("[^a-zA-Z0-9_-]", $loginid)))
{
echo("SQL Injection Detected");
exit();
}
$character_check = $db->Execute("SELECT Name FROM Character WHERE Name=? and AccountID=?",array($charactername,$loginid));
$character_check_ = $character_check->numrows();
$online_check = $db->Execute("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id=?",array($loginid));
$row2 = $online_check->fetchrow();
$result = $db->Execute("Select Clevel,Resets,Money,LevelUpPoint,class From Character where Name=?",array($charactername));
$row = $result->fetchrow();
$resetup=$row[1] + (1);
$resetmoeny=$row[2]-($muweb['resetmoney']);
$resetpt=$row[3] + ($muweb['resetpoints']);
$resetpt1=$muweb['resetpoints'] * ($row[1] + 1);
if ($character_check_ <= 0){$error=1;
show_error("$warning_start Character $charactername Does Not Exist! $warning_end");
}
if ($row2[0] != 0){ $error=1;
show_error("$warning_start Character $charactername Is Online, Must Be Logged Off! $warning_end");
}
if ($resetmoeny < 0){ $error=1;
show_error("$warning_start $charactername Need $muweb[resetmoney] Zen To Reset! $warning_end");
}
if ($row[0] < $muweb['resetlevel']){ $error=1;
show_error("$warning_start $charactername Need Level $muweb[resetlevel] To Reset! $warning_end");
}
if ($row[1] > $muweb['resetslimit']){ $error=1;
show_error("$warning_start Resets limit is set to $muweb[resetslimit]! $warning_end");
}
if($error!=1){
if(($muweb['resetmode']=='keep') AND ($muweb['levelupmode']=='normal')){
$sql_reset_script="Update character set [clevel]='1',[experience]='0',[money]='$resetmoeny',[LevelUpPoint]='$resetpt',[resets]='$resetup' where name=?";}
elseif(($muweb['resetmode']=='reset') AND ($muweb['levelupmode']=='extra')){
$sql_reset_script="Update character set [strength]='25',[dexterity]='25',[vitality]='25',[energy]='25',[clevel]='1',[experience]='0',[money]='$resetmoeny',[LevelUpPoint]='$resetpt1',[resets]='$resetup' where name=?";}
elseif(($muweb['resetmode']=='keep') AND ($muweb['levelupmode']=='extra')){
$sql_reset_script="Update character set [clevel]='1',[experience]='0',[money]='$resetmoeny',[LevelUpPoint]='$resetpt1',[resets]='$resetup' where name=?";}
elseif(($muweb['resetmode']=='reset') AND ($muweb['levelupmode']=='normal')){
$sql_reset_script="Update character set [strength]='25',[dexterity]='25',[vitality]='25',[energy]='25',[clevel]='1',[experience]='0',[money]='$resetmoeny',[LevelUpPoint]='$resetpt',[resets]='$resetup' where name=?";}
if($muweb['clean_inventory']=='yes' && $muweb['clean_skills']=='yes'){
$sql_reset_script2="UPDATE character Set [inventory]=CONVERT(varbinary(1080), null),[magiclist]= CONVERT(varbinary(180), null) Where name=?";}
elseif($muweb['clean_inventory']=='no' && $muweb['clean_skills']=='no'){
$sql_reset_script2="Select name from character where name=?";}
elseif($muweb['clean_inventory']=='yes' && $muweb['clean_skills']=='no'){
$sql_reset_script2="UPDATE character Set [inventory]=CONVERT(varbinary(1080), null) Where name=?";}
elseif($muweb['clean_inventory']=='no' && $muweb['clean_skills']=='yes'){
$sql_reset_script2="UPDATE character Set [magiclist]= CONVERT(varbinary(180), null) Where name=?";}
$sql_reset_exec = $db->Execute($sql_reset_script,array($charactername));
$sql_reset_exec2 = $db->Execute($sql_reset_script2,array($charactername));
show_error("$ok_start $charactername SuccessFully Reseted! $ok_end");
$logfile = 'logs/resets_logs.php';
$ip = $_SERVER['REMOTE_ADDR'];
$date = date('Y-m-d H:i');
$data = "Character $_POST[reset_character] Has Been <font color=#FF0000>Reseted</font>, Before Reset:$row[1](resets), After Reset:$resetup(resets), All Those On $date By ip:$ip \n";
$fp = fopen($logfile, 'a');
fputs($fp, $data);
fclose($fp);
}
}
?></table>