I'm trying to make a script so that on certain maps if a character is killed it will kick the character and delete it permantently. I put it as a bindcmd for ease of testing. I can't seem to get the sql for some tables to carry out this task. I am familiar with using sql and part of the functions are carried out, but deleting stuff such as char, inventory, cart inventory, and a couple other tables will not delete. I supect it is blocked in some way by the character server. I went through the entire table database to look for anything that retained specific character data to delete, but some of the tables below may be specific to my server. I don't remember which ones at the moment.
Peopleperson49
- script NightTerror -1,{
OnNightTerror:
set NTCheck,1;
atcommand "@kick "+strcharinfo(0)+"";
end;
OnPCLogoutEvent:
if(playerattached()==0) { end; }
if(NTCheck!=1) { end; } else { set NTCheck,0; }
set .char_id,getcharid(0);
query_sql("DELETE FROM atcommandlog WHERE `char_id` ="+.char_id);
//query_sql("DELETE FROM BalanceRank WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM bonus_script WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM branchlog WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM buyingstore_items WHERE `buyingstore_id` = "+.char_id);
query_sql("DELETE FROM buyingstores WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM cashlog WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM cp_charprefs WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM cp_choko_rename_log WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM elemental WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM emprank WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM friends WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM guild WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM guild_member WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM homunculus WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM hotkey WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM memo WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM mercenary WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM mercenary_owner WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM mvplog WHERE `kill_char_id` ="+.char_id);
query_sql("DELETE FROM mvprank WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM npclog WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM party WHERE `leader_char` = "+.char_id);
query_sql("DELETE FROM pet WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM picklog WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM pvprank WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM quest WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM sc_data WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM skill WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM skillcooldown WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM vendings WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM zenylog WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM inventory WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM cart_inventory WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM global_reg_value WHERE `char_id` ="+.char_id);
query_sql("DELETE FROM char WHERE `char_id` ="+.char_id);
end;
OnInit:
bindatcmd("nightterror",strnpcinfo(0)+"::OnNightTerror");
end;
}
Question
Peopleperson49
I'm trying to make a script so that on certain maps if a character is killed it will kick the character and delete it permantently. I put it as a bindcmd for ease of testing. I can't seem to get the sql for some tables to carry out this task. I am familiar with using sql and part of the functions are carried out, but deleting stuff such as char, inventory, cart inventory, and a couple other tables will not delete. I supect it is blocked in some way by the character server. I went through the entire table database to look for anything that retained specific character data to delete, but some of the tables below may be specific to my server. I don't remember which ones at the moment.
Peopleperson49
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.