[Help] Проблем с модул Гранд Резет

Holder

New Member
Joined
Dec 27, 2010
Messages
434
Reaction score
43
Значи, опитвам се да сложа , този модул, само, че като избера, герой със 150 рестарта и се опитам да направя 1 GR, ми пише, че има недостатъчно рестарта .. а съм го направил да иска 50 рестарта.. погледнах в MuOnline > Character table - няма grand reset таблица, да не би да не може да запише 1 Gr понеже няма таблица и да ми дава тази грешка и ако е така, как да направя тази таблица, а ако не е от това от какво е ?

Edit:
$querychar = mssql_query("Select resets,grresets from character where name='$character'");
от това си правя извода, че търси resets, grresets а аз grresets - нямам, как да ги създам ?

Code:
<?
/* 
   MFS Team Web 0.5
   by Diablo
   http://*********************/
*/
?>
<?php
global $grandreset;
global $grand_res_credits;

if($grandreset != 0) { echo"This page is disabled";}
else
{
if(secure($_SESSION['user']) == true) { dogrand_reset(); }
elseif(isset($_POST['submit'])) { grand_reset(); }
else{
?>
<br>Each one sold reset is equivalent to One "Gr" in Rankings !
<br>1 Reset = <?php echo($grand_res_credits);?> Credits!
<table border=0 cellspacing=5 cellpadding=0>
<td width='250'>
<form name="" method="post" action="">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr> 
<td width="70"><font color=>Login ID :</td>
<td>
<input name="login" type="text" id="login" maxlength="10">
</td>
</tr>
<tr> 
<td width="70"><font color=>Password :</td>
<td><input name="password" type="password" id="password" maxlength="16">
</td>
</tr>
<tr> 
<td width="70">&nbsp;</td>

</tr>
<tr>
<tr> 
<td width="100" align="right"><input type="submit" class=button name="submit" value="Submit"></td>
<td><input type="reset" class=button name="Submit2" value="Reset"></td>
</tr>
</table>
</form>
</div>
</td>
</table>
<?php
}
}
?>


Това съм сложил в config.php
Code:
// Grand Reset
$grand_res_credits = "2000";   // How much credits to give
$grand_res_resets = "50";   // How much resets will need to have

Това са му функциите:
Code:
function dogrand_reset()
{
$account = secure($_SESSION['user']);
global $grand_res_credits;
global $grand_res_resets;
if(isset($_POST['exchange']))
{
$account = secure($_SESSION['user']);
$character = secure($_POST['character']);
$resets = secure($_POST['resets']);
check_inject();

$querychar = mssql_query("Select resets,grresets from character where name='$character'");
$char = mssql_fetch_row($querychar);

$newresets = $char[0] - $resets;
$newgrresets = $char[1] + 1;

if($newresets < 0) { echo"<br><font color='red'>Not enought resets!</font><br>"; $error = 1; }
elseif($resets < $grand_res_resets) { echo"<br><font color='red'>Error! You need more resets.</font><br>"; $error = 1; }
elseif($error != 1) { 

$credits = $resets * $grand_res_credits;

echo"<br><font color='green'>You exchange $resets reset(s) for $credits credits</font><br>";

$a = mssql_query("Update Character set resets='$newresets',GrResets='$newgrresets' where name='$character'");
$b = mssql_query("Update MEMB_CREDITS set credits = credits+$credits WHERE memb___id='$account'");

}
}

$query = mssql_query("Select name,resets from character where AccountID='$account'");

echo"
<form action='' name='' method='POST'>
<select id='character' name='character'><optgroup label='Select a character'>
";

for($i=0;$i < mssql_num_rows($query);++$i)
{
$row = mssql_fetch_row($query);
echo"
<option value='$row[0]'>$row[0] [$row[1]]</option>

";
}

echo"</select>
<br><input type='text' size='25' id='resets' name='resets' />
<br><input type='submit' maxlength='2' value='exchange' name='exchange'>
</form>
<br>Each one sold reset is equivalent to One 'GR' in Rankings !
<br>1 Reset = $grand_res_credits Credits!
";
}

Code:
function grand_reset()
{

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

check_inject();

$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);

if(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($onlinecheck  >= 1) { echo"<font color='red'>Account $account is online!Please LogOff First!</font><br>"; $error=1;}
if($error != 1) {

$_SESSION['user'] = $account;

dogrand_reset();

}
}
 
Last edited:
трябва да създадеш таблица grreset и там да се записват
 
  • Like
Reactions: Holder
Ам grresets или grreset, щото май търси grresets да не объркам ?