
Originally Posted by
Teleeg
To be honest, if a user deletes a char, it should stay deleted. It's the players choice... And I would not delete any character just because i need space. If you do that, you probably have a shit server provider.
"space", "hosting provider" wait, what? This just gives the player the ability to do everything, and I myself take a shit on it and I'm not using it for my server. And we've already said so before. This was just a fun experience to code.
Code:
if(isset($_POST['restore']))
{
if($_POST['lul'] == "")
{
echo "Please, select a Character.";
return false;
}
$q = mssql_query("SELECT COUNT(*) AS COUNT FROM Character WHERE AID = ".$_SESSION['aid']." AND DeleteFlag != 1");
if(mssql_result($q, 0, 'COUNT') < 4)
{
$charnum_q = mssql_query("SELECT MAX(CharNum) AS CharNum FROM Character WHERE AID = ".$_SESSION['aid']." AND DeleteFlag != 1");
$charnum = mssql_result($charnum_q, 0, 'CharNum') + 1;
$update = mssql_query("UPDATE Character SET Name = '".$_POST['lul']."', DeleteFlag = 0, DeleteName = 'NULL', CharNum = ".$charnum." WHERE DeleteName = '".$_POST['lul']."'");
echo "The Character ".$_POST['lul']." was successfully restored.";
}
else
{
echo "You do not have enough Character Slots to restore any Characters.";
return false;
}
}