trizzy Posted May 28, 2015 Posted May 28, 2015 if (query_sql("SELECT `name` FROM `char` WHERE `name` = '"+escape_sql(.@new$)+"'")) { mes .NPC$; mes "This name already exists"; close; } The script that i found is working fine, but whenever i put this code, event the "Name" is available it keeps telling me "This name already exists". can someone correct it? Thank You. Quote
trizzy Posted May 28, 2015 Author Posted May 28, 2015 I believe query_sql is returning -1 if nothing was found. I'm not sure if this was changed in the default rAthena or just some other server I've encountered it before, but personally I think it's dumb. Anyways... if ( query_sql( "SELECT `name` FROM `char` WHERE `name` = '"+escape_sql(.@new$)+"'", .@name$ ) <= 0 ) { is not working too. But i found a Solution from the script that i posted i just change the .@new$ into .@name$ and it works. here where i found http://www.eathena.ws/board/lofiversion/index.php/t265846.htmlso this topic is closed. [sOLVED] Quote
Skorm Posted May 28, 2015 Posted May 28, 2015 I believe query_sql is returning -1 if nothing was found. I'm not sure if this was changed in the default rAthena or just some other server I've encountered it before, but personally I think it's dumb. Anyways... if ( query_sql( "SELECT `name` FROM `char` WHERE `name` = '"+escape_sql(.@new$)+"'", .@name$ ) <= 0 ) { Quote
Skorm Posted May 28, 2015 Posted May 28, 2015 is not working too. But i found a Solution from the script that i posted i just change the .@new$ into .@name$ and it works. here where i found http://www.eathena.ws/board/lofiversion/index.php/t265846.htmlso this topic is closed. [sOLVED] Actually I was going to suggest that but you didn't give me enough of the code to work with. Next time paste full code and what emulator you're using so the problem can be resolved more effectively. Otherwise you're just wasting our time, thank you! Quote
trizzy Posted May 28, 2015 Author Posted May 28, 2015 is not working too. But i found a Solution from the script that i posted i just change the .@new$ into .@name$ and it works. here where i found http://www.eathena.ws/board/lofiversion/index.php/t265846.htmlso this topic is closed. [sOLVED] Actually I was going to suggest that but you didn't give me enough of the code to work with. Next time paste full code and what emulator you're using so the problem can be resolved more effectively. Otherwise you're just wasting our time, thank you! Ohh sorry i thought knew the problem when you comment about what i'm asking. sorry my bad ,but anyway thanks for your appreciation. Quote
Question
trizzy
The script that i found is working fine, but whenever i put this code, event the "Name" is available it keeps telling me
"This name already exists". can someone correct it?
Thank You.
4 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.