15.04.2017, 14:02
Hi, I'm creating a namechange dialog and I don't want the player to be able to change his name if it's used already, but it's not working for some reason. This is the part which is not working:
so basically it returns 0 rows while there is actually a row with the name I'm trying to set for myself. What's the problem?
EDIT: lol i'm stupid it has to be %q
Код:
new query[100], DBResult:result; format(query, sizeof(query), "SELECT COUNT(*) FROM accounts WHERE Name = 'q' COLLATE NOCASE", inputtext); result = db_query(database, query); if (db_get_field_int(result, 0)) ShowPlayerDialog(playerid, DIALOG_CHANGE_NAME, DIALOG_STYLE_INPUT, "Change Name", "That name is already in use by someone else.\nPlease type your new desired name below:", "Change", "Cancel");
EDIT: lol i'm stupid it has to be %q