How to add Grand Reset System to your muweb site
Hi all,
This is the code i've added to my muweb 0.9 Premium, that has php clear code(not using that cipher function).
It simply ads a Grand Reset page where players can grand reset themselves, so they do not bother administrators all the time.
I've tested it and worked with no problems for me.
Here is what u must do:
open file website_ROOT\sub_pages\Characters.php
find:
Code:
<li><a href="'.$muweb['servername'].'-Characters-Info.html">'._Characters_Info.'</a></li>
after this line add:
Code:
<li><a href="'.$muweb['servername'].'-Characters-GrandReset.html">GrandReset</a> <span style="color:red;"> New</span></li>
then find:
BEFORE THIS LINE ADD:
PHP Code:
//GR SYSTEM
case "GrandReset":
$grdb=mssql_connect('localhost', 'SQL_USERNAME', 'SQL_PASSWORD') or die('error');
@mssql_select_db('MuOnline') or die('error');
$GRquery="SELECT Name FROM Character WHERE AccountID='".$_SESSION['user_login_name']."' AND resets>=100";
$GRdata=mssql_query($GRquery);
if ($_POST['Char']!="")
{
$GRquery="SELECT * FROM Character WHERE AccountID='".$_SESSION['user_login_name']."' AND name='".$_POST['Char']."'";
$GRdata=mssql_query($GRquery);
$GRrow = mssql_fetch_array($GRdata);
if ($GRrow['Resets']>=100)
{
if ($GRrow['Resets']>100)
{
$GRr=$GRrow['Resets']-100;
$GRpts=intval(25+10000+2000*$GRr); //10000 is the 10k points left that the character will have after GR
$GRquery="Update Character SET [Resets]='0',[LevelUpPoint]='".$GRpts."',[strength]='25',[dexterity]='25',[vitality]='25',[energy]='25' WHERE AccountID='".$_SESSION['user_login_name']."' AND name='".$_POST['Char']."'";
}
else
{
$GRquery="Update Character SET [Resets]='0',[LevelUpPoint]='10000',[strength]='25',[dexterity]='25',[vitality]='25',[energy]='25' WHERE AccountID='".$_SESSION['user_login_name']."' AND name='".$_POST['Char']."'"; //10000 is the 10k points left that the character will have after GR
}
@mssql_query($GRquery) or die('Error While Trying to Stats Reset! <br/>'.mssql_get_last_message());
//--
$crquery="Select * FROM MEMB_CREDITS WHERE memb___id='".$_SESSION['user_login_name']."'";
$crdata=mssql_query($crquery);
$crrow = mssql_fetch_array($crdata);
$GRcredits=$crrow['credits'];
//--
$GRcredits=$GRcredits+1000; //1000 is the credits reward
$GRquery="Update MEMB_CREDITS SET [credits]='$GRcredits' WHERE memb___id='".$_SESSION['user_login_name']."'";
@mssql_query($GRquery) or die('Error While Trying to Add WebShop Credits! <br/>'.mssql_get_last_message());
echo 'Character '.$_POST['Char'].' was successfully GrandReseted!<br/>';
echo 'Credits were added to your WebShop Account!';
}
}
else
{
echo '
<script type="text/javascript">
function get_radio_value()
{
for (var i=0; i < document.myform.Char.length; i++)
{
if (document.myform.Char[i].checked)
{
rad_val = document.myform.Char[i].value;
alert("Character Selected: "+rad_val+" Will Be Grand Reseted! :)");
return true;
}
}
}
</script>
';
echo '<form name="myform" action="AvengerSMu-Characters-GrandReset.html" method="POST">';
$GRchars=0;
do {
while ($row = mssql_fetch_row($GRdata)) {
echo ('<input type="radio" name="Char" value="'.$row[0].'"> '.$row[0].'<br> ');
$GRchars = $GRchars +1;
}
} while (mssql_next_result($GRdata));
echo '<input type="submit" value="Submit" onClick="return get_radio_value();"/></form>';
if ($GRchars == 0)
{
echo "No Character over 100 RR found !";
}
}
break;
//END OF GR SYSTEM
Now it is configured to enable GR at 100RR with 1000 credits reward.
It also reset stats to 25 points and adds 10k point to add.
Feel free to post here if you need extra explanations or 2 get helo to reconfigure the code in order to meet your requirements!
Hope it helps !
Re: How to add Grand Reset System to your muweb site
well is it possible to make it a 5 resets for the grand reset? and 65400 on all stats instead of back to 25?
Re: How to add Grand Reset System to your muweb site
I'm sure it is possible. It just requires a bit fixing :)
Re: How to add Grand Reset System to your muweb site
nice, works perfectly fine for me, thanks a bunch :p
Re: How to add Grand Reset System to your muweb site
When in website press GrandReset New , just showing ERROR
edit - Sorry , all is working ty!
Who to get in Ranking , top5 to shows GrandResets?
Re: How to add Grand Reset System to your muweb site
Yes, I have the same, how to make GrandReset showing on Rankings?
Re: How to add Grand Reset System to your muweb site
Re: How to add Grand Reset System to your muweb site
learn the PHP thing :P
Posted via Mobile Device
Re: How to add Grand Reset System to your muweb site
Quote:
Originally Posted by
laFk
When in website press GrandReset New , just showing ERROR
edit - Sorry , all is working ty!
Who to get in Ranking , top5 to shows GrandResets?
Hello can you tell me how you got it to work.? i get error
Re: How to add Grand Reset System to your muweb site
Yeah i get error too...
Can someone post with more detail on adding the PHP line. Because thats where i get the error...
edit - Ok I got it to work but the grand Reset count is not adding to my Ranking Can anyone tell me how to get it to add?
Re: How to add Grand Reset System to your muweb site
Quote:
Originally Posted by
nemosad
Hello can you tell me how you got it to work.? i get error
Same here. Can someone help with this? :(:
Re: How to add Grand Reset System to your muweb site
Quote:
Originally Posted by
4ufo89
Yeah i get error too...
Can someone post with more detail on adding the PHP line. Because thats where i get the error...
edit - Ok I got it to work but the grand Reset count is not adding to my Ranking Can anyone tell me how to get it to add?
same problem with count if somebody will have the pleasure to change a little bit the script to update in Characters table the GrandRes collum to show in rankings , it`s same like Reset script
UPDATE Characters
SET GrandRes='+1' bla bla but i am noob on php.
Re: How to add Grand Reset System to your muweb site
Re: How to add Grand Reset System to your muweb site
Hello all i dont understand </tr></tbody>'; } $res_con .='</table><br>'; } brea;ALL PHP cood need put here?? case "AddStats": if(read_module(32) == 0){ echo locked('For the moment this page is closed...Please try again latter.','370'); }else{ if(isset($_GET['op3']) && check_c($_GET['op3'],$_SESSION['user_login_name']) == true){ if(isset($_POST['add'])){ $lvlup = clean_variable($_POST['str']) + clean_variable($_POST['agi']) + clean_va
pleas help :)
Re: How to add Grand Reset System to your muweb site
Quote:
Originally Posted by
Phenomenw
error me two and addstats is offine now .