[Req] Grand Reset Web Module

knif3r

Active Member
Joined
Jan 29, 2012
Messages
349
Reaction score
97
Търсих на доста места, взимах от уебове дали аз го инсталирам грешно (по-вероятно) или е от друго не знам, но ми трябва спешно Grand Reset модул.

Ако може да рестартира статс на героя, да добавя Х кредита, да го връща на 1 рес, да проверява дали е онлайн и дали Resets=>100;
Стига да работи дизайна няма значение.

Имена на таблици и колони :

Table Character : LevelUpPoints,cLevel,Resets,Grand_Resets,Money,Strenght,Dexterity,Vitality,Energy,LeaderShip;
Table MEMB_CREDITS :
memb___id, credits;
Table MEMB_STAT :
ConnectStat,memb___id;

Благодаря предварително, ще се реванширам ако мога! :)
 
По моя статистика в 90% от случаите,когато са ме викали да оправям подобен проблем се оказва,
че в таблицата е записано Grand_Resets,
обаче вътре в модула се търси GrandReset
Погледни внимателно тази подробност,и ако няма разминаване между имената от модула и тези от таблицата,пиши да ти го оправя.
Поне за сега не съм срещал модул,който да не работи.
 
Last edited:
  • Like
Reactions: knif3r
Може би $SESSION е грешно в самия модул? и +1 наистина в 8/10 случая проблема е ,че таблицата е Grand_Reset.
 
Last edited:
  • Like
Reactions: knif3r
Таблицата ми е Grand_Resets във всеки модул който до сега пробвах се налагаше да я променям, опитах да използвам скрипта ми за ресет модула и да го редактирам така, че да добавя гранд рес и кредити, уви със сигурност правя нещо грешно :D

Можете ли да ми дадете просто някой код за който знаете, че работи и да опитам да го редактирам ако не стане ще го кача пак, и ако греша поне да знам къде.
 
Last edited:
Ако питаш мен не се занимавай с неща,които не са ти ясни на 100%,
защото рискуваш да се прецакаш,и ще е хубаво ако го разбереш преди някой друг...
Ето ти един модул на MeMoS,който работи на 100% ,но нали се сещаш,
че ако не ползваш неговия сайт,ще трябва да си добавиш и нужните функций към модула...
И да не забравиш да промениш $acc = $_SESSION['dt_username'];
както е в твоя сайт.

grand_reset.php
-------------------
PHP:
<?php
if(isset($_POST['greset']))
{
	$store = do_grand_reset();
	show_messages($store);
}
?>
<form action="?p=grandreset" method="post">
	<ul class="form" style="width:67%;">
		<li>
			<span>Character: </span>
			<select name="character" id="character">
				<option value="">-</option>
				<?php
					$query = mssql_query("SELECT TOP 10 * FROM Character WHERE AccountID='" . $_SESSION['dt_username'] . "' ORDER BY GrandResets DESC, Resets DESC, cLevel DESC");

					while($row = mssql_fetch_array($query)):
				?>
				<option value="<?php echo $row['Name']; ?>"> <?php echo $row['Name']; ?>: [<?php echo $row['cLevel']; ?>][<?php echo $row['Resets']; ?>]</option>
				<?php endwhile; ?>
			</select>
			<input  class="button" name="greset" type="submit" value="Reset Character" />
		</li>
	</ul>
</form>
<br />
<table>
	<tbody>
		<tr>
			<td class="tdTitle">COST</td>
			<td><?php echo number_format($option['gr_zen']); ?> Zen</td>
		</tr>
		<tr>
			<td class="tdTitle">LEVEL</td>
			<td><?php echo $option['gr_level']; ?></td>
		</tr>
		<tr>
			<td class="tdTitle">RESETS</td>
			<td><?php echo $option['gr_resets']; ?></td>
		</tr>
		<tr>
			<td class="tdTitle">MAX GRAND RESETS</td>
			<td><?php echo $option['gr_max_resets']; ?></td>
		</tr>
		<tr>
			<td class="tdTitle">REWARD</td>
			<td><?php echo $option['gr_reward']; ?> <?php echo $option['gr_reward_name']; ?></td>
		</tr>
	</tbody>
</table>

Това са няколко функций,които ще трябва да добавиш за да работи:
----------------------
PHP:
function do_grand_reset()
	{
		global $option;
		$acc = $_SESSION['dt_username'];
		$char = $_POST['character'];
		
		$show_msg=array(
			'error'=>array()
		);
		
		if(empty($char))
		{
			$show_msg['error'][] = 'Please select a character!';
		}
		elseif(preg_match('/[^a-zA-Z0-9\_\-]/', $char))
		{
			$show_msg['error'][] = 'Invalid symbols!';
		}
		elseif(strlen($char) < 3 || strlen($char) > 10)
		{
			$show_msg['error'][] = 'Invalid Character Name!';
		}
		else
		{
			$is_acc_char = mssql_num_rows(
				mssql_query("SELECT Name FROM Character WHERE AccountID='". $acc ."' AND Name='". $char ."'")
			);

			$is_online = is_online($char, 1);
			$character = char_info($char);
			
			$new_gr = ($character['GrandResets'] + 1);
			
			$new_res = ($character['Resets'] - $option['gr_resets']);
			
			$new_money = ($character['Money'] - $option['gr_zen']);
		
			if($is_acc_char == 0)
			{
				$show_msg['error'][] = 'This character is not yours!';
			}
			elseif($is_online === 1)
			{
				$show_msg['error'][] = 'You need to leave the game!';
			}
			elseif($character['cLevel'] < $option['gr_level'])
			{
				$show_msg['error'][] = 'You need '.($option['gr_level'] - $character['cLevel']).' more levels!';
			}
			elseif($new_res < 0)
			{
				$show_msg['error'][] = 'You need '.($option['gr_resets'] - $character['Resets']).' more resets!';
			}
			elseif($new_money < 0)
			{
				$show_msg['error'][] = 'You don't have enough money(zen)!';
			}
			elseif($new_gr > $option['gr_max_resets'])
			{
				$show_msg['error'][] = 'You have reach the maximum grand resets!';
			}
			else
			{
				$sql ="UPDATE Character SET Resets = ". $new_res .", Money = ".$new_money.", GrandResets = ". $new_gr .", LevelUpPoint = ". $option['gr_reward'] .",cLevel = 1,Experience = 0 WHERE Name='".$character['Name']."' AND AccountID='".$acc."'";
				mssql_query($sql);
				
				if($option['gr_credits'] === 1)
				{
					$reward = mssql_fetch_row(
						mssql_query("SELECT ". $option['cr_db_column'] ." FROM ". $option['cr_db_table'] ." WHERE " . $option['cr_db_check_by'] ."='" . $acc . "'")
					);
					
					$gr_reward=($reward[0] + $option['gr_reward']);
					
					$sql2 = "UPDATE ". $option['cr_db_table'] ." SET ". $option['cr_db_column'] ." = ".$gr_reward." WHERE  " . $option['cr_db_check_by'] ."='" . $acc . "'";
					mssql_query($sql2);
				}
				
				$show_msg['success'][0] = $char .' have successfully grand reset for '.$new_gr.' time.';
			}
		}
		return $show_msg;
	}

PHP:
function show_msg($msg, $num = 0)
{
	$label = ($num === 0) ? 'error' : 'success';
	$message[$label] = array();
	$message[$label][] = $msg;
	show_messages($message);
}

PHP:
function is_online($char_name, $only_user=0)
{
	$accountid = mssql_fetch_row(
		mssql_query("SELECT AccountID FROM Character WHERE Name='". $char_name ."'")
	);
	
	$check_status = mssql_fetch_row(
		mssql_query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id='". $accountid[0] ."'")
	);
	
	$name = mssql_fetch_row(
		mssql_query("SELECT GameIDC FROM AccountCharacter WHERE id='". $accountid[0] ."'")
	);
	
	if($only_user===1 && $check_status[0] >= 1){ return 1; }
	elseif($check_status[0] >= 1 && $name[0] == $char_name){ return 1; }
	else{ return 0; }
}

PHP:
function char_info($char_name)
{
	$char = mssql_fetch_array(
		mssql_query("SELECT * FROM Character WHERE Name='". $char_name ."'")
	);
	
	$guild = mssql_fetch_array(
		mssql_query("SELECT G_Name FROM GuildMember WHERE Name='". $char['Name'] ."'")
	);
	
	if($guild['G_Name']==NULL)
	{
		$char['cGuild'] = 'No Guild';
	}
	else
	{
		$char['cGuild'] = $guild['G_Name'];
	}
	return $char;
}

Това трябва да го добавиш в config файла:
---------------------------------------------------
PHP:
	// gr = Grand Reset
	$option['gr_level'] = 400; // Level required to grand reset
	$option['gr_resets'] = 10; // Resets required to grand reset
	$option['gr_zen'] = 20000000; // Zen required to grand reset
	$option['gr_reward'] = 1000; // Reward for a grand reset - this is also the after gr start points
	$option['gr_max_resets'] = 10; // Max grand resets
	$option['rc_gr_bonus'] = 1; // Reward points for grand reset: 1 = enable, 0 =  disable
	$option['gr_credits'] = 1; // Reward credits: 1 = enable, 0 = disable
	$option['gr_reward_name'] = 'Credits & Points'; // Reward name: Points,Credits,Coins, etc... This is only text
	$option['cr_db_table'] = 'MEMB_CREDITS'; // DB table name for the reward: if reward savoy credits table = MEMB_CREDITS
	$option['cr_db_column'] = 'credits'; // DB column name for the reward: if reward savoy credits column = credits
	$option['cr_db_check_by'] = 'memb___id'; // What column is checked: if reward savoy credits column = memb___id

И ако не съм забравил нещо,трябва да заработи.
И ако го подкараш,да не забравиш >> credits MeMoS (party)
 
Last edited:
  • Like
Reactions: knif3r
Благодаря за отговора! Но май пак бъркам някъде въпреки, че си го обяснил много добре
Хубавото е, че разчита информацията от config файла, но не ми показва листа с героите и преди имах този проблем дори когато натисна Reset Character вместо да ми даде грешката която е описана (please select a character) ме праща обратно на индекса и с този проблем се сблъсквах..
Ще прикача файловете тук ако искаш ги погледни даваше ми на няколко пъти parse error мисля, че направих всичко описано.

7925782u.png


greset.php
HTML:
<?
include 'grfunc.php';
?>
<form action="?p=grandreset" method="post">
    <ul class="form" style="width:67%;">
        <li>
            <span>Character: </span>
            <select name="character" id="character">
                <option value="">-</option>
                <?php
                    $query = mssql_query("SELECT TOP 10 * FROM Character WHERE AccountID=' ".secure($_GET['username'])." ' ORDER BY Grand_Resets DESC, Resets DESC, cLevel DESC");

                    while($row = mssql_fetch_array($query)):
                ?>
                <option value="<?php echo $row['Name']; ?>"> <?php echo $row['Name']; ?>: [<?php echo $row['cLevel']; ?>][<?php echo $row['Resets']; ?>]</option>
                <?php endwhile; ?>
            </select>
            <input  class="button" name="greset" type="submit" value="Reset Character" />
        </li>
    </ul>
</form>
<br />
<table>
    <tbody>
        <tr>
            <td class="tdTitle">COST</td>
            <td><?php echo number_format($option['gr_zen']); ?> Zen</td>
        </tr>
        <tr>
            <td class="tdTitle">LEVEL</td>
            <td><?php echo $option['gr_level']; ?></td>
        </tr>
        <tr>
            <td class="tdTitle">RESETS</td>
            <td><?php echo $option['gr_resets']; ?></td>
        </tr>
        <tr>
            <td class="tdTitle">MAX GRAND RESETS</td>
            <td><?php echo $option['gr_max_resets']; ?></td>
        </tr>
        <tr>
            <td class="tdTitle">REWARD</td>
            <td><?php echo $option['gr_reward']; ?> <?php echo $option['gr_reward_name']; ?></td>
        </tr>
    </tbody>
</table>

grfunc.php
HTML:
<?php
function show_msg($msg, $num = 0)
{
    $label = ($num === 0) ? 'error' : 'success';
    $message[$label] = array();
    $message[$label][] = $msg;
    show_messages($message);
}  
function char_info($char_name)
{
    $char = mssql_fetch_array(
        mssql_query("SELECT * FROM Character WHERE Name='". $char_name ."'")
    );
    
    $guild = mssql_fetch_array(
        mssql_query("SELECT G_Name FROM GuildMember WHERE Name='". $char['Name'] ."'")
    );
    
    if($guild['G_Name']==NULL)
    {
        $char['cGuild'] = 'No Guild';
    }
    else
    {
        $char['cGuild'] = $guild['G_Name'];
    }
    return $char;
}  
function is_online($char_name, $only_user=0)
{
    $accountid = mssql_fetch_row(
        mssql_query("SELECT AccountID FROM Character WHERE Name='". $char_name ."'")
    );
    
    $check_status = mssql_fetch_row(
        mssql_query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id='". $accountid[0] ."'")
    );
    
    $name = mssql_fetch_row(
        mssql_query("SELECT GameIDC FROM AccountCharacter WHERE id='". $accountid[0] ."'")
    );
    
    if($only_user===1 && $check_status[0] >= 1){ return 1; }
    elseif($check_status[0] >= 1 && $name[0] == $char_name){ return 1; }
    else{ return 0; }
}  
function do_grand_reset()
    {
        global $option;
        $acc = $_GET['username'];
        $char = $_POST['character'];
        
        $show_msg=array(
            'error'=>array()
        );
        
        if(empty($char))
        {
            $show_msg['error'][] = 'Please select a character!';
        }
        elseif(preg_match('/[^a-zA-Z0-9\_\-]/', $char))
        {
            $show_msg['error'][] = 'Invalid symbols!';
        }
        elseif(strlen($char) < 3 || strlen($char) > 10)
        {
            $show_msg['error'][] = 'Invalid Character Name!';
        }
        else
        {
            $is_acc_char = mssql_num_rows(
                mssql_query("SELECT Name FROM Character WHERE AccountID='". $acc ."' AND Name='". $char ."'")
            );

            $is_online = is_online($char, 1);
            $character = char_info($char);
            
            $new_gr = ($character['Grand_Resets'] + 1);
            
            $new_res = ($character['Resets'] - $option['gr_resets']);
            
            $new_money = ($character['Money'] - $option['gr_zen']);
        
            if($is_acc_char == 0)
            {
                $show_msg['error'][] = 'This character is not yours!';
            }
            elseif($is_online === 1)
            {
                $show_msg['error'][] = 'You need to leave the game!';
            }
            elseif($character['cLevel'] < $option['gr_level'])
            {
                $show_msg['error'][] = 'You need '.($option['gr_level'] - $character['cLevel']).' more levels!';
            }
            elseif($new_res < 0)
            {
                $show_msg['error'][] = 'You need '.($option['gr_resets'] - $character['Resets']).' more resets!';
            }
            elseif($new_money < 0)
            {
                $show_msg['error'][] = 'You dont have enough money(zen)!';
            }
            elseif($new_gr > $option['gr_max_resets'])
            {
                $show_msg['error'][] = 'You have reach the maximum grand resets!';
            }
            else
            {
                $sql ="UPDATE Character SET Resets = ". $new_res .", Money = ".$new_money.", Grand_Resets = ". $new_gr .", LevelUpPoint = ". $option['gr_reward'] .",cLevel = 1,Experience = 0 WHERE Name='".$character['Name']."' AND AccountID='".$acc."'";
                mssql_query($sql);
                
                if($option['gr_credits'] === 1)
                {
                    $reward = mssql_fetch_row(
                        mssql_query("SELECT ". $option['cr_db_column'] ." FROM ". $option['cr_db_table'] ." WHERE " . $option['cr_db_check_by'] ."='" . $acc . "'")
                    );
                    
                    $gr_reward=($reward[0] + $option['gr_reward']);
                    
                    $sql2 = "UPDATE ". $option['cr_db_table'] ." SET ". $option['cr_db_column'] ." = ".$gr_reward." WHERE  " . $option['cr_db_check_by'] ."='" . $acc . "'";
                    mssql_query($sql2);
                }
                
                $show_msg['success'][0] = $char .' have successfully grand reset for '.$new_gr.' time;
            }
        }
        return $show_msg;
    }  
?>
 
Забелязвам,че форумът променя скриптовете,и излиза че съм ти го написал грешно,а не съм!
Ако искаш пиши ми по някое време на скайпа,че така няма да стане и до петък (sun)

И виждам,че ползваш $_GET а не $_SESSION...,
и сигурен ли си,че зарежда от където трябва(ако изобщо я зарежда) "secure()"
И опитай да махнеш "Grand_Resets DESC," от заявката за проба...
Да остане само така:
PHP:
$query = mssql_query("SELECT TOP 10 * FROM Character WHERE AccountID='" . secure($_GET['username']) . "' ORDER BY Resets DESC, cLevel DESC");

@DeadmanWonderland
Аз само давам пример,а не споря за защита и т.н...
За мен НЯМА защитен сайт,за Вас не знам ;):
 
Last edited:
  • Like
Reactions: knif3r and Deadman
Просто си прикачи reset модула и някой ще ти го преправи на grandreset.
 
  • Like
Reactions: knif3r
Reset Module-a
HTML:
<?
//if(!$login) { echo "<img src='img/l.gif' OnLoad=\"location.reload();\">"; }
echo "   
<table align='center' class='fborder'>
<div align='center' style='font-size: 15px; padding-top: 3px; padding-bottom: 3px; margin-top: 5px; margin-bottom: 0px;'>Reset Character information:</div>
<tr>
<td class='proba'>&nbsp;</td>
<tr><td align='center'>1. Maximum restarts: ".$shopy['misc']['maxresets']."</td></tr>
<tr><td align='center'>2. Character must be at least ".$shopy['misc']['resetlevel']." level to Reset!</td></tr>
<tr><td align='center'>3. Reset Character costs ".number_format($shopy['misc']['resetmoney'])." zen.</td></tr>
<tr><td align='center'>4. Please remove all items from your personal store (Shop) before reset.</td></tr>
<tr><td align='center'>5. After the restart your character will be at level 1. </td></tr>
<tr><td align='center'>6. With every reset you get stronger and stronger.</td></tr>
<tr><td align='center'>7. Your character will appear in the select menu, when you are at least ".$shopy['misc']['resetlevel']."  level.</td></tr>
<td>&nbsp;</td>
</tr>
</table>";

$i = 0;
$query = mssql_query("SELECT * FROM Character WHERE AccountID='".secure($_COOKIE['username'])."' AND cLevel>='".$shopy['misc']['resetlevel']."'");
while($char = mssql_fetch_array($query)) 
{
	if($char['Name'] == $_GET['char']) { $bann = " selected"; } else { $bann = ""; }
	$mychars .= "<option value='".htmlspecialchars($char['Name'])."'$bann>".$char['Name']."</option>";
	$i++;
}


	echo "<center>Character: <select id='char'><optgroup label='Select a char'>$mychars</select><br /><input type='submit'  class='button' OnClick=\"ajax('resetchar&'+doc('char'),'Character Reset '+document.getElementById('char').value)\" value='Reset Character '></center>";


if($_GET['char'])
{
	$online = mssql_fetch_array(mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='".secure($_COOKIE['username'])."' AND ConnectStat = 1"));
	$chara = mssql_fetch_array(mssql_query("SELECT * FROM Character WHERE Name = '".secure($_GET['char'])."'"));
	
	$newresets = $chara['Resets'] + 1;
    $newmoney = $chara['Money'] - $shopy['misc']['resetmoney'];
    $newpoints = $chara['Resets'] * $shopy['misc']['resetpoints'];
    $bonus = $chara['LevelUpPoint'] + $shopy['misc']['resetpoints'];
   
    if(@$online)
	{
		$output = "Your account is online. Must to be offline to use this function.";
		$error = true;
	}
	elseif($chara['cLevel'] < $shopy['misc']['resetlevel'])  
	{
		$output = "Error: Character ".$chara['Name']." haven't got ".$shopy['misc']['resetlevel']." level to reset.";
		$error = true;
	}
	elseif($newresets > $shopy['misc']['maxresets'])  
	{
		$output = "Error: Character ".$chara['Name']." have reached the maximum resets.";
		$error = true;
	}
    elseif($chara['Money'] < $shopy['misc']['resetmoney'])  
	{
		$output = "Error: Character ".$chara['Name']." haven't got ".number_format($shopy['misc']['resetmoney'])." money to reset.";
		$error = true;
	}
	elseif(!$error)
	{
	if ($shopy['misc']['type'] == "keep") {
    $a = mssql_query("Update Character Set Money='".$newmoney."',clevel='1',Experience='0',Resets='".$newresets."' WHERE Name='".$chara['Name']."'");
    } elseif ($shopy['misc']['type'] == "bonus") {
    $a = mssql_query("Update Character Set Money='".$newmoney."',clevel='1',Experience='0',Resets='".$newresets."',LevelUpPoint='".$bonus."' WHERE Name='".$chara['Name']."'");
    } elseif ($shopy['misc']['type'] == "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='".$chara['Name']."'");
    }
  	$output = "Character ".$chara['Name']." successfully restarted and now is ".$newresets." resets. <img src='img/l.gif' Onload=\"logged()\">";
	}
	echo "<br /><center>".$output."</center><br /><br />";	
}

?>

Config.php
HTML:
$shopy['misc']['maxresets']		= '999'; 			
$shopy['misc']['resetlevel']		= '400'; 			
$shopy['misc']['resetmoney']		= '1000000'; 			
$shopy['misc']['type']			= 'keep'; 		// Reset type (keep,bonus,reset)	
$shopy['misc']['resetpoints']		= '0';
 
PHP:
<?php
//if(!$login) { echo "<img src='img/l.gif' OnLoad=\"location.reload();\">"; }

$account = secure($_COOKIE['username']);
$maximumgrandresets = $shopy['misc']['maximum_grandresets'];
$grandresetlevel = $shopy['misc']['grandreset_level'];
$grandresetprice = $shopy['misc']['grandreset_price'];

echo "<table align='center' class='fborder'>
    <div align='center' style='font-size: 15px; padding-top: 3px; padding-bottom: 3px; margin-top: 5px; margin-bottom: 0px;'>Grand Reset Character information:</div>
    <tr>
        <td class='proba'>&nbsp;</td>
        <tr><td align='center'>1. Maximum restarts: ".$maximumgrandresets."</td></tr>
        <tr><td align='center'>2. Character must be at least ".$grandresetlevel." level to Reset!</td></tr>
        <tr><td align='center'>3. Grand Reset Character costs ".number_format($grandresetprice)." zen.</td></tr>
        <tr><td align='center'>4. Please remove all items from your personal store (Shop) before reset.</td></tr>
        <tr><td align='center'>5. After the restart your character will be at level 1. </td></tr>
        <tr><td align='center'>6. With every reset you get stronger and stronger.</td></tr>
        <tr><td align='center'>7. Your character will appear in the select menu, when you are at least ".$grandresetlevel."  level.</td></tr>
        <td>&nbsp;</td>
    </tr>
</table>";

$i = 0;
$query = mssql_query("SELECT * FROM Character WHERE AccountID='".$account."' AND cLevel>=".$grandresetlevel."");

while($char = mssql_fetch_array($query))
{
    if($char['Name'] == $_GET['char'])
    {
        $bann = " selected";
    }
    else
    {
        $bann = "";
    }

    $mychars .= "<option value='".htmlspecialchars($char['Name'])."'$bann>".$char['Name']."</option>";
    $i++;
}

echo "<center>Character: <select id='char'><optgroup label='Select a char'>$mychars</select><br /><input type='submit'  class='button' OnClick=\"ajax('greset&'+doc('char'),'Character Reset '+document.getElementById('char').value)\" value='Grand Reset Character '></center>";

if($_GET['char'])
{
    $online = mssql_fetch_array(mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='".$account."' AND ConnectStat = 1"));
    $chara = mssql_fetch_array(mssql_query("SELECT * FROM Character WHERE Name = '".secure($_GET['char'])."'"));

    $requiredresets = $shopy['misc']['grandreset_required_resets'];
    $currentgrandresets = $chara['Grand_Resets'];
    $newpoints = ($currentgrandresets+1) * $shopy['misc']['grandreset_bonuspoints'];
    $bonus = $chara['LevelUpPoint'] + $shopy['misc']['grandreset_bonuspoints'];
    $bonuswebshopcredits = $shopy['misc']['grandreset_bonuscredits'];

    if(@$online)
    {
        $output = "Your account is online. Must to be offline to use this function.";
        $error = true;
    }
    else if($chara['cLevel'] < $grandresetlevel)  
    {
        $output = "Error: Character ".$chara['Name']." haven't got ".$grandresetlevel." level to reset.";
        $error = true;
    }
    else if($chara['Resets'] < $requiredresets)
    {
        $output = "Error: Character ".$chara['Name']." don't have ".number_format($requiredresets)." resets.";
        $error = true;
    }
    else if($currentgrandresets >= $maximumgrandresets)  
    {
        $output = "Error: Character ".$chara['Name']." have reached the maximum grand resets.";
        $error = true;
    }
    else if($chara['Money'] < $grandresetprice)  
    {
        $output = "Error: Character ".$chara['Name']." haven't got ".number_format($grandresetprice)." money to reset.";
        $error = true;
    }
    else if(!$error)
    {
        if($shopy['misc']['grandreset_type'] == "keep")
        {
            mssql_query("Update Character Set Money=Money-".$grandresetprice.",clevel=1,Experience=0,Resets=Resets-".$requiredresets.",Grand_Resets=Grand_Resets+1 WHERE Name='".$chara['Name']."'");
        }
        else if($shopy['misc']['grandreset_type'] == "bonus")
        {
            mssql_query("Update Character Set Money=Money-".$grandresetprice.",clevel=1,Experience=0,Resets=Resets-".$requiredresets.",Grand_Resets=Grand_Resets+1, LevelUpPoint=".$bonus." WHERE Name='".$chara['Name']."'");
        }
        else if($shopy['misc']['grandreset_type'] == "reset")
        {
            mssql_query("Update Character Set Strength=25,Dexterity=25,Vitality=25,Energy=25,LeaderShip=25,Money=Money-".$grandresetprice.",clevel=1,Experience=0,Resets=Resets-".$requiredresets.",Grand_Resets=Grand_Resets+1,LevelUpPoint=".$newpoints." WHERE Name='".$chara['Name']."'");
        }

        if($bonuswebshopcredits > 0)
        {
            if(mssql_num_rows(mssql_query("SELECT * FROM MEMB_CREDITS WHERE memb___id='".$account."'")) == 0)
            {
                mssql_query("INSERT INTO MEMB_CREDITS(memb___id, credits) VALUES('".$account."', ".$bonuswebshopcredits.")");
            }
            else
            {
                mssql_query("UPDATE MEMB_CREDITS SET credits=credits+".$bonuswebshopcredits." WHERE memb___id='".$account."'");
            }
        }

        $output = "Character ".$chara['Name']." successfully restarted and now is ".number_format($currentgrandresets+1)." grand resets. <img src='img/l.gif' Onload=\"logged()\">";

    }

    echo "<br /><center>".$output."</center><br /><br />";
}
?>
За config.php

PHP:
$shopy['misc']['maximum_grandresets'] = 100;
$shopy['misc']['grandreset_level'] = 400;
$shopy['misc']['grandreset_price'] = 50000000;
$shopy['misc']['grandreset_required_resets'] = 100;
$shopy['misc']['grandreset_bonuspoints'] = 500;
$shopy['misc']['grandreset_type'] = "keep";
$shopy['misc']['grandreset_bonuscredits'] = 1000;
Не съм го тествал за грешки.

@До автора на модула - този език не е за теб.
 
  • Like
Reactions: knif3r
Всичко изглежда ОК обаче прави обикновен рестарт, без да адва grand reset, credits или lvl up точки, за кредитите видях, че го няма зададено обаче за grand reseta не знам защо не го адва, даже при success виждам, че си написал да изписва currentgrandresets мен ми изписва currentresets.

П.С. Изпълни се без грешки.

За автора - мисля, че е mi7aka :D :D
 
Всичко изглежда ОК обаче прави обикновен рестарт, без да адва grand reset, credits или lvl up точки, за кредитите видях, че го няма зададено обаче за grand reseta не знам защо не го адва, даже при success виждам, че си написал да изписва currentgrandresets мен ми изписва currentresets.

П.С. Изпълни се без грешки.

За автора - мисля, че е mi7aka :D :D
Това с кредитите го бях пропуснал. (xax) Обновил съм модула.
 
  • Like
Reactions: knif3r
АУУУУУУУУУУУУУУУУУУУУУУ <3 <3 <3 <3 <3

Работи по-добре от колкото съм се надявал благодаря ти много! Кажи ми ако има нещо с което и аз мога да ти бъда полезен каквото и да е и благодаря на всички които ми отговориха, не можех да искам повече! :) :)