Registration help
#1

When I try to register it always tells me that I am already registered.

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;
}
Reply


Messages In This Thread
Registration help - by TopAz07 - 19.12.2010, 06:27
Re: Registration help - by TopAz07 - 19.12.2010, 07:10
Re: Registration help - by [UG]Scripter - 19.12.2010, 07:13
Re: Registration help - by TopAz07 - 19.12.2010, 07:18
Re: Registration help - by [L3th4l] - 19.12.2010, 07:33
Re: Registration help - by Mean - 19.12.2010, 07:41
Re: Registration help - by TopAz07 - 19.12.2010, 08:22

Forum Jump:


Users browsing this thread: 3 Guest(s)