- Joined
- Jul 30, 2010
- Messages
- 177
- Reaction score
- 4
Whenever a player resets a character in website, all items in store are lost. How do we fix this?
Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Join Today!Whenever a player resets a character in website, all items in store are lost. How do we fix this?
function reset_character()
{
global $resetmoney;
global $resvid;
global $bonus_points;
global $reset_clear_inv;
global $reset_clear_skill;
global $max_resove;
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] * $bonus_points; }
$newleveluppoints = $row[3] + $bonus_points;
$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 > $max_resove) { 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($resvid == keep)
{
$a = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets' where name='$character'");
}
elseif($resvid == bonus)
{
$a = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'");
}
elseif($resvid == reset)
{
$a = mssql_query("Update Character Set Strength='25',Dexterity='25',Vitality='25',Energy='25' ,Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'");
}
if($reset_clear_inv == yes) { $b = mssql_query("UPDATE Character set Inventory=CONVERT(varbinary(1080), null) WHERE Name='$character'"); }
if($reset_clear_skill == yes) { $c = mssql_query("Update Character set magiclist= CONVERT(varbinary(60), null) WHERE Name='$character'"); }
}
}
}
Hello, I'm having a little problem with this:
Code:Loading php_gd2.dll Failed! Please Enable php_gd2.dll in your php.ini");} $connect = mssql_connect($host,$user,$password); $db = mssql_select_db($database,$connect); if(!$db) die(' Connection with SQL Server failed! '); ?> ( ! ) Fatal error: Call to undefined function mssql_query() in C:\wamp\www\a\config.php on line 87 Call Stack # Time Memory Function Location 1 0.0003 417360 {main}( ) ..\index.php:0 2 0.0004 438816 include( 'C:\wamp\www\a\config.php' ) ..\index.php:2
And php_gd2.dll is present and active in the ini! Still, it gives me the error!