Dori Posted June 16, 2015 Group: Members Topic Count: 105 Topics Per Day: 0.02 Content Count: 332 Reputation: 15 Joined: 12/11/11 Last Seen: August 8, 2017 Share Posted June 16, 2015 I want to know how to completely clear everything related to a certain account (char, storage, inventory, pets..etc) with SQL. Thank you. Quote Link to comment Share on other sites More sharing options...
Kurofly Posted June 16, 2015 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 283 Reputation: 31 Joined: 07/08/14 Last Seen: January 15, 2022 Share Posted June 16, 2015 - script DeleteAccount -1,{ OnInit: bindatcmd "delaccount",strnpcinfo(0)+"::OnDelete",99,99; // @delaccount <account_id> end; OnDelete: .@account_id = atoi(.@atcmd_parameters$); setarray .@log$ , "atcommandlog","branchlog","cashlog","chatlog","loginlog","mvplog","npclog","picklog","zenylog"; setarray .@ragnarok$ , "auction","bonus_script","buyingstore_items","buyingstores","cart_inventory","char","charlog","elemental", "friends","global_reg_value","guild","guild_alliance","guild_castle","guild_expulsion","guild_member", "guild_position","guild_skill","guild_storage","homunculus","hotkey","interlog","interreg","inventory", "ipbanlist","login","mail","mapreg","memo","mercenary","mercenary_owner","party","pet","quest","ragsrvinfo", "sc_data","skill","skill_homunculus","skillcooldown","sstatus","storage","vendig_items","vendings"; for (.@i = 0 ; .@i < getarraysize(.@log$) ; .@i++) query_sql("DELETE FROM `log`.`"+.@log$[.@i]+"` WHERE `` = '"+account_id+"'"); for (.@i = 0 ; .@i < getarraysize(.@ragnarok$) ; .@i++) query_sql("DELETE FROM `ragnarok`.`"+.@ragnarok$[.@i]+"` WHERE `` = '"+account_id+"'"); dispbottom "all SQL data has been erased on account_id "+.@account_id; } There must be another simplier way to do it but I don't know it ^^ Make sure that all those tables are in your sql workbench and add those which are missing (I didn't put my custom tables and my vote table but I still have the auction tables) I din't test it but it's pretty simple so there should be no problem. Quote Link to comment Share on other sites More sharing options...
Question
Dori
I want to know how to completely clear everything related to a certain account (char, storage, inventory, pets..etc) with SQL.
Thank you.
Link to comment
Share on other sites
1 answer 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.