trizzy Posted May 28, 2015 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 92 Reputation: 2 Joined: 01/04/15 Last Seen: April 27, 2021 Share 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 Link to comment Share on other sites More sharing options...
trizzy Posted May 28, 2015 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 92 Reputation: 2 Joined: 01/04/15 Last Seen: April 27, 2021 Author Share 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 Link to comment Share on other sites More sharing options...
Skorm Posted May 28, 2015 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share 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 Link to comment Share on other sites More sharing options...
Skorm Posted May 28, 2015 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share 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 Link to comment Share on other sites More sharing options...
trizzy Posted May 28, 2015 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 92 Reputation: 2 Joined: 01/04/15 Last Seen: April 27, 2021 Author Share 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 Link to comment Share on other sites More sharing options...
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.
Link to comment
Share on other sites
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.