Reset Master skill zteam s8
Hello!
this code will not add ML_POINT. what is wrong with this? anyone can help. thanks in advance.
PHP Code:
<?php
$config = simplexml_load_file( "engine/config_mods/clear_skills_settings.xml" );
$active = trim( $config->active );
if ( $active == "0" )
{
echo msg( "0", text_sorry_feature_disabled );
}
else
{
if ( isset( $_GET['sid'] ) )
{
echo "<div style=\"margin-top: 10px;\">";
$id = safe_input( $_GET['sid'], "" );
if ( empty( $id ) || !is_numeric( $id ) )
{
header( "Location: ".$core_run_script."" );
exit( );
}
else if ( character_and_account( $id, $user_auth_id ) === false )
{
header( "Location: ".$core_run_script."" );
exit( );
}
else if ( account_online( $user_auth_id ) === true )
{
echo msg( "0", text_resetstats_t1 );
}
else
{
$update_stats = $core_db->Execute("Update Character set [MagicList]=CONVERT(varbinary(450), null) where mu_id=?", array( $id) );
$check_for_memb_id = $core_db2->Execute("Select Name from Character where AccountID=?",array($user_auth_id));
if($check_for_memb_id->EOF){
$set_credits = $core_db2->Execute("insert into T_MasterLevelSystem (CHAR_NAME,ML_POINT)VALUES(?,?)",array($user_auth_id));
}else{
$set_credits = $core_db2->Execute("Update T_MasterLevelSystem set ML_POINT=ML_POINT+1000 where CHAR_NAME=?",array($user_auth_id));
}
if($update_stats && $set_credits)
{
echo msg( "1", 'Master Skill successfully reseted.');
}
else
{
echo msg( "0", 'Unable to reset master skill, reason: system error, please contact administrator.');
}
}
}
?>
Re: Reset Master skill zteam s8
Quote:
Originally Posted by
banlawan
Hello!
this code will not add ML_POINT. what is wrong with this? anyone can help. thanks in advance.
PHP Code:
<?php
$config = simplexml_load_file( "engine/config_mods/clear_skills_settings.xml" );
$active = trim( $config->active );
if ( $active == "0" )
{
echo msg( "0", text_sorry_feature_disabled );
}
else
{
if ( isset( $_GET['sid'] ) )
{
echo "<div style=\"margin-top: 10px;\">";
$id = safe_input( $_GET['sid'], "" );
if ( empty( $id ) || !is_numeric( $id ) )
{
header( "Location: ".$core_run_script."" );
exit( );
}
else if ( character_and_account( $id, $user_auth_id ) === false )
{
header( "Location: ".$core_run_script."" );
exit( );
}
else if ( account_online( $user_auth_id ) === true )
{
echo msg( "0", text_resetstats_t1 );
}
else
{
$update_stats = $core_db->Execute("Update Character set [MagicList]=CONVERT(varbinary(450), null) where mu_id=?", array( $id) );
$check_for_memb_id = $core_db2->Execute("Select Name from Character where AccountID=?",array($user_auth_id));
if($check_for_memb_id->EOF){
$set_credits = $core_db2->Execute("insert into T_MasterLevelSystem (CHAR_NAME,ML_POINT)VALUES(?,?)",array($user_auth_id));
}else{
$set_credits = $core_db2->Execute("Update T_MasterLevelSystem set ML_POINT=ML_POINT+1000 where CHAR_NAME=?",array($user_auth_id));
}
if($update_stats && $set_credits)
{
echo msg( "1", 'Master Skill successfully reseted.');
}
else
{
echo msg( "0", 'Unable to reset master skill, reason: system error, please contact administrator.');
}
}
}
?>
it doesnt clear all ML Skills of Character :)
Re: Reset Master skill zteam s8
@Maddox ML skill is fully clear. my point is the ML_Point at T_MasterLevelSystem table will not add points.
Re: Reset Master skill zteam s8
PHP Code:
where CHAR_NAME=?",array($user_auth_id));
You are trying add Master Level to Account Name not Character Name.
PHP Code:
insert into T_MasterLevelSystem (CHAR_NAME,ML_POINT)VALUES(?,?)",array($user_auth_id));
You are trying to insert data into masterlevel table, expecting 2 values (only 1 given and again, it's wrong (account name))
PHP Code:
$check_for_memb_id = $core_db2->Execute("Select Name from Character where AccountID=?",array($user_auth_id));
You are checking if character exist? then wtf you requested? reset from no-where?
Use some logic like you can see on example
PHP Code:
// Clear Skills (null won't be fine for every server files, so in case of problems use str-repeat or full code)
$clear_skills = $core_db->Execute("Update Character set [MagicList]=CONVERT(varbinary(450), null) where mu_id=?", array($id));
// Retrieve Character Name for ML Data
$character_name = $core_db->Execute("Select Name from Character where mu_id = ?", array($id));
$character = $character_name->fields[0];
// Check If ML Data exist
$check_mldata = $core_db->Execute("Select * from T_MasterLevelSystem where CHAR_NAME = ?",array($character));
if($check_mldata->EOF) {
// Does not exist, so no need to update, let's set true
$set_mldata = true;
} else {
// Exist ? Let's restore ml points?
$set_mldata = $core_db->Execute("Update T_MasterLevelSystem set ML_POINT = MASTER_LEVEL where CHAR_NAME=?",array($character));
}
if($clear_skills && $set_mldata)
Re: Reset Master skill zteam s8
@4FUNer very thankful man. you are the best. :top:
Re: Reset Master skill zteam s8
Restore All SD in Master Skills not cleared :D
Re: Reset Master skill zteam s8
Quote:
Originally Posted by
Maddox
Restore All SD in Master Skills not cleared :D
Take code of clean character skills from sql (remove default one's) & update it with full code or using str_repeat
Set MagicList = 0xCODE
I've mentioned above
Code:
// Clear Skills (null won't be fine for every server files, so in case of problems use str-repeat or full code)
Learn 2 read pls.
zTeam s8 example
PHP Code:
Set MagicList = 0xFF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000
Re: Reset Master skill zteam s8
Quote:
Originally Posted by
4FUNer
Take code of clean character skills from sql (remove default one's) & update it with full code or using str_repeat
Set MagicList = 0x
CODE
I've mentioned above
Code:
// Clear Skills (null won't be fine for every server files, so in case of problems use str-repeat or full code)
Learn 2 read pls.
zTeam s8 example
PHP Code:
Set MagicList = 0xFF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000
i see thanks., can you add Level Requirements in this Clear Skills? thanks :)
God Bless as always :)
Re: Reset Master skill zteam s8
Quote:
Originally Posted by
Maddox
i see thanks., can you add Level Requirements in this Clear Skills? thanks :)
God Bless as always :)
Don't be lazy, add yourself :D
Re: Reset Master skill zteam s8
Quote:
Originally Posted by
4FUNer
Don't be lazy, add yourself :D
ill already try but its not working, im not so good in php, and in terms of this i know someone who can, its you, you help lots of people here thats why im here to ask for your help... thanks God bless :)
Re: Reset Master skill zteam s8
wews i cant put level requirements, im always get error...........
http://i60.tinypic.com/2mraz37.png
it detects that my char is low level but script still reset mg char skills :D
4FUNer can you give me some clue ,please :)
Thanks :)
Re: Reset Master skill zteam s8
Quote:
Originally Posted by
Maddox
wews i cant put level requirements, im always get error...........
http://i60.tinypic.com/2mraz37.png
it detects that my char is low level but script still reset mg char skills :D
4FUNer can you give me some clue ,please :)
Thanks :)
Add check there
PHP Code:
if (account_online($user_auth_id) === true) {
echo msg('0', text_clearskills_t1);
} elseif (YOUR LEVEL CHECK) { // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
echo msg('0', 'Unable to reset, reason: you do no have required level.');
} else {
but of course retrieve level before like
PHP Code:
$level_check = $core_db->Execute("Select cLevel from Character where mu_id = ? and AccountID = ?",array($id,$user_auth_id));
and call it like
PHP Code:
} elseif ($level_check->fields[0] < 666) {
666 = LEVEL_REQUIRED
Hope you understand.