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;
}
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 YukaLink to comment
Share on other sites