MySQL Problems ...
#10

may it be a login problem ... ?

Код:
public OnPlayerLogin(playerid,password[])
{
	new tmp2[64],tmp[64];
    new string2[64];
	new playername[MAX_PLAYER_NAME];
	MySQLCheckConnection();
    GetPlayerName(playerid, playername, sizeof(playername));
    format(tmp, sizeof(tmp), "SELECT COUNT(*) FROM players WHERE Name='%s'", playername);
    SQLLog(tmp);
    samp_mysql_query(tmp);
	//if (DEBUG) SQLLog(tmp);
    samp_mysql_store_result();
    samp_mysql_fetch_row(tmp);
	new registered = strval(tmp);
	if (registered > 0)
 	{
	  	if (!strlen(password))
		{
		    ShowPlayerDialog(playerid,5,DIALOG_STYLE_INPUT,"Autentificare","Ati introdus o parola gresita !\nVa rugam sa introduceti parola corecta !\n\n\n\n\t\t\t\tLinkMania","Login","Iesire");
			SendClientMessage(playerid, 0xE24541FF, "SERVER: Ai introdus o parola gresita !");
	        gPlayerLogTries[playerid] += 1;
	        if(gPlayerLogTries[playerid] == 4)
			{
				new banip[16];
				GetPlayerIp(playerid, banip, sizeof(banip));
				new string[128];
				GetPlayerName(playerid, playername, sizeof(playername));
				format(string, sizeof(string), "Parola gresita de 4 ori : %s", playername);
				AddBan("LinkMania", 999999, banip, string,0);
			}
	        return 1;
		}
		new ipaddress[16];
		GetPlayerIp(playerid, ipaddress, sizeof(ipaddress));
		MySQLFetchAcctSingle(PlayerInfo[playerid][pSQLID], "Password", PlayerInfo[playerid][pKey]);
		if(strcmp(PlayerInfo[playerid][pKey],password,false) == 0) // aaa != AAA
		{
			LoadPlayerData(playerid);
			LoadPlayerLeveling(playerid);
			LoadPlayerProfile(playerid);
			LoadPlayerObjects(playerid);
			LoadPlayerCriminalR(playerid);
			LoadPlayerSkill(playerid);
			LoadPlayerKeysLyc(playerid);
			LoadPlayerIgnoreL(playerid);
			LoadPlayerOthers(playerid);
		}
		else
		{
		    ShowPlayerDialog(playerid,5,DIALOG_STYLE_INPUT,"Autentificare","Ati introdus o parola gresita !\nVa rugam sa introduceti parola corecta !\n\n\n\n\t\t\t\tLinkMania","Login","Iesire");
			SendClientMessage(playerid, 0xE24541FF, "SERVER: Ati introdus o parola gresita !");
	        gPlayerLogTries[playerid] += 1;
	        if(gPlayerLogTries[playerid] == 4)
			{
			    new banip[16];
				GetPlayerIp(playerid, banip, sizeof(banip));
				new string[128];
				GetPlayerName(playerid, playername, sizeof(playername));
				format(string, sizeof(string), "Parola gresita de 4 ori : %s", playername);
				AddBan("LinkMania", 999999, banip, string,0);
			}
	        return 1;
		}
		new string[256];
		ResetPlayerCash(playerid);
		ConsumingMoney[playerid] = true;
		GivePlayerCash(playerid,PlayerInfo[playerid][pCash]);

		if(PlayerInfo[playerid][pReg] == 0)
		{
			PlayerInfo[playerid][pLevel] = 1;
			PlayerInfo[playerid][pSHealth] = 0.0;
			PlayerInfo[playerid][pHealth] = 100.0;
			PlayerInfo[playerid][pInt] = 15;
			PlayerInfo[playerid][pLocal] = 255;
			PlayerInfo[playerid][pTeam] = 3;
			PlayerInfo[playerid][pSkin] = 183;
			new randphone = 1000 + random(8999);
			PlayerInfo[playerid][pPnumber] = randphone;
			PlayerInfo[playerid][pPhousekey] = 255;
			PlayerInfo[playerid][pPbiskey] = 255;
			PlayerInfo[playerid][pAccount] = 5000;
			PlayerInfo[playerid][pReg] = 1;
			ResetPlayerCash(playerid);
			GivePlayerCash(playerid,1000);
		}
Reply


Messages In This Thread
MySQL Problems ... - by FlashInTheNighT - 24.10.2010, 08:44
Re: MySQL Problems ... - by Retardedwolf - 24.10.2010, 08:46
Re: MySQL Problems ... - by iJumbo - 24.10.2010, 08:46
Re: MySQL Problems ... - by FlashInTheNighT - 24.10.2010, 08:55
Re: MySQL Problems ... - by iJumbo - 24.10.2010, 09:06
Re: MySQL Problems ... - by FlashInTheNighT - 24.10.2010, 14:09
Re: MySQL Problems ... - by vection - 24.10.2010, 15:01
Re: MySQL Problems ... - by FlashInTheNighT - 24.10.2010, 15:42
Re: MySQL Problems ... - by FlashInTheNighT - 24.10.2010, 16:28
Re: MySQL Problems ... - by FlashInTheNighT - 28.10.2010, 20:48

Forum Jump:


Users browsing this thread: 4 Guest(s)