19.12.2010, 06:27
When I try to register it always tells me that I am already registered.
This is the Code:
This is the Code:
Код:
COMMAND:register(playerid, params[]) { new password[128],string[128]; if(sscanf(params, "s[128]", password)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /register [password]"); else { if (PlayerInfo[playerid][pPlayerLogged] == 1) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in."); if(strlen(params) > 30) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: Password is too long."); format(string, sizeof(string), "users/%s.ini", PlayerName(playerid)); mysql_real_escape_string(PlayerName(playerid), Escape[2]); if(dini_Exists(string)) return SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: That name is already registered, and not converted!"); format(string, 128, "SELECT * FROM Accounts WHERE Username = '%s'", Escape[2]); mysql_query(string); mysql_store_result(); if(mysql_num_rows() == 0) { mysql_free_result(); OnPlayerRegister(playerid, password); OnConnectInit(playerid); OnPlayerDataSave(playerid); SendClientMessage(playerid, COLOR_WHITE, "SERVER: Type /login [password] to continue."); return 1; } else { SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: That name is already registered!"); mysql_free_result(); } } return 1; }