Jump to content
  • 0
Yuka

Character Deletion Script (workaround)

Question

Hi,

since my client is bugging with the character deletion, I've just written a script to do it.

Could you please check if it is not exploitable/ doing something wrong?

It seems to work fine for me though, but would be glad to have someone checking it before releasing it.

lhz_in03,255,257,3    script    Chardel    93,{
    set [email protected], getcharid(3);
    mes .npcname$;
    mes "Hello ^6495ED"+strcharinfo(0)+"^000000.";
    mes "Would you like to delete a character?";
    if (select("No:Yes")  == 1){
        next;
        mes .npcname$;
        mes "Alright, see you then.";
        close;
    }
    next;
    mes .npcname$;
    mes "Please enter the Character's name.";
    mes "Note that you can only delete characters on your own account.";
    input([email protected]$);
    query_sql "SELECT account_id FROM `char` WHERE name = '"[email protected]$+"'",[email protected];
    if ([email protected] != [email protected]){
        next;
        mes .npcname$;
        mes "^ff0000I could not find this character on your account!^000000";
        close;
    }
    if (strcharinfo(0) == [email protected]$){
        next;
        mes .npcname$;
        mes "^ff0000Please log in with a different character to delete this one.^000000";
        close;
    }
    next;
    mes .npcname$;
    mes "Do you really want to delete this character?";
    if (select("No:Yes")  == 1){
        next;
        mes .npcname$;
        mes "Alright, see you then.";
        close;
    }
    next;
    mes .npcname$;
    mes "Okay, I have deleted this character from your account.";
    query_sql "DELETE FROM `char` WHERE `name`='"[email protected]$+"'";
    close;
    end;
    OnInit:
        set .npcname$, "[^6495EDCharacter Deletion^000000]";
        end;
}

Thanks! :)

Edited by Yuka
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

if you want ..... then i can add some more ...

  1. data in other SQL tables that related to that character
  2. Items within the characters that you're going to delete
  3. Guild that current characters joined
  4. etc
Link to comment
Share on other sites

 

Could you please check if it is not exploitable/ doing something wrong?

    input([email protected]$);
    query_sql "SELECT account_id FROM `char` WHERE name = '"[email protected]$+"'",[email protected];

just to point this line.. don't forget to use escape_sql to prevent sql injection

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.