Wrong password but it is correct...?
#1

After i register an account and then press on Register the login box comes and then i type the password and i'm sure 100% that's the password is correct but it tells me that's the password is wrong...
Any one can help me, please?
Note: I use XAMPP for a database
Reply
#2

Is the way you check for the correct password coded correctly?
Reply
#3

Show your Register & Login stuff
Reply
#4

Quote:
Originally Posted by DTV
Посмотреть сообщение
Is the way you check for the correct password coded correctly?
Quote:
Originally Posted by DTV
Посмотреть сообщение
Show your Register & Login stuff
Код:
public OnPlayerRegister(playerid, password[])
{
	if(IsPlayerConnected(playerid))
	{
		new playername3[MAX_PLAYER_NAME];
		GetPlayerName(playerid, playername3, sizeof(playername3));
		new Str[200];
		mysql_format(SQL,Str,sizeof(Str),"INSERT INTO `users` (`name`,`password`) VALUES ('%s','%s')",playername3,password);
		mysql_tquery(SQL,Str,"","");
		strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
		PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
	    GetPlayerHealthEx(playerid,PlayerInfo[playerid][pHealth]);
		if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
		{
     	    PlayerInfo[playerid][pPos_x] = 2246.6;
     	    PlayerInfo[playerid][pPos_y] = -1161.9;
     	    PlayerInfo[playerid][pPos_z] = 1029.7;
		}
		if(Spectate[playerid] != -1)
		{
			PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
			PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
			PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
			PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
			PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
		}
		new str[128];
		mysql_format(SQL,str,128,"UPDATE users SET `pHealth`='%.1f' WHERE `name`='%s'",PlayerInfo[playerid][pHealth],PlayerInfo[playerid][pNormalName]);
		mysql_tquery(SQL,str,"","");
		ShowPlayerDialog(playerid,DIALOG_LOGIN2,DIALOG_STYLE_PASSWORD,"SERVER: Login","Welcome to Yellow Bugged Server.\n\nPlease enter your password below!","Login","Cancel");
		return 1;
	}
	return 1;
}

public OnPlayerLogin(playerid,password[])
{
	new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    GameTextForPlayer(playerid, "~w~LOADING...~n~~y~CHECKING THE PASSWORD", 700, 3);
    new playerip[16];
	GetPlayerIp(playerid,playerip,sizeof(playerip));
	if(NumIp(playerip, playerid) >= 3 && !IsBotOnIP(playerip))
	{
 		SendClientMessage(playerid, COLOR_LIGHTRED, "There are already 2 players connected with same IP.");
 		Kick(playerid);
 		return 1;
	}
    new qstr[256];
    format(qstr,100,"SELECT * FROM users WHERE `name`='%s' AND `password`='%s'",playername2,password);
    new Cache: pass = mysql_query(SQL,qstr);
    if(cache_get_row_count() > 0)
    {
		cache_get_field_content(0, "password", PlayerInfo[playerid][pKey], SQL, 130);
    	cache_get_field_content(0, "name", PlayerInfo[playerid][pNormalName], SQL, 130);
    	PlayerInfo[playerid][pLevel]                    = cache_get_field_content_int(0, "Level");
    	PlayerInfo[playerid][pAdmin]                    = cache_get_field_content_int(0, "Admin");
    	PlayerInfo[playerid][pHelper]                   = cache_get_field_content_int(0, "Helper");
    	PlayerInfo[playerid][pPremiumAccount]           = cache_get_field_content_int(0, "Premium");
    	PlayerInfo[playerid][pBeta]                     = cache_get_field_content_int(0, "Beta");
    	PlayerInfo[playerid][pSupport]                  = cache_get_field_content_int(0, "Support");
    	PlayerInfo[playerid][pManagerLideri]            = cache_get_field_content_int(0, "ManagerLideri");
    	PlayerInfo[playerid][pManagerLideriSupport]     = cache_get_field_content_int(0, "ManagerLideriSupport");
    	PlayerInfo[playerid][pManagerDepartamente]      = cache_get_field_content_int(0, "ManagerDepartamente");
    	PlayerInfo[playerid][pManagerTaxi]              = cache_get_field_content_int(0, "ManagerTaxi");
    	PlayerInfo[playerid][pManagerInstructori]       = cache_get_field_content_int(0, "ManagerInstructori");
    	PlayerInfo[playerid][pManagerMedici]            = cache_get_field_content_int(0, "ManagerMedici");
    	PlayerInfo[playerid][pManagerHitman]            = cache_get_field_content_int(0, "ManagerHitman");
    	PlayerInfo[playerid][pPremiumPoints]            = cache_get_field_content_int(0, "PremiumPoints");
    	PlayerInfo[playerid][pConnectTime]              = cache_get_field_content_int(0, "ConnectedTime");
    	PlayerInfo[playerid][pReg]                      = cache_get_field_content_int(0, "Registered");
    	PlayerInfo[playerid][pSex]                      = cache_get_field_content_int(0, "Sex");
    	PlayerInfo[playerid][pAge]                      = cache_get_field_content_int(0, "Age");
		PlayerInfo[playerid][pGasCan]                   = cache_get_field_content_int(0, "GasCan");
    	PlayerInfo[playerid][pOrigin]                   = cache_get_field_content_int(0, "Origin");
    	PlayerInfo[playerid][pMuted]                    = cache_get_field_content_int(0, "Muted");
	 	PlayerInfo[playerid][pMuteTime]                 = cache_get_field_content_int(0, "MuteTime");
    	PlayerInfo[playerid][pExp]                      = cache_get_field_content_int(0, "Respect");
    	PlayerInfo[playerid][pCash]                     = cache_get_field_content_int(0, "Money");
    	PlayerInfo[playerid][pAccount]                  = cache_get_field_content_int(0, "Bank");
    	PlayerInfo[playerid][pCrimes]                   = cache_get_field_content_int(0, "Crimes");
    	PlayerInfo[playerid][pKills]                    = cache_get_field_content_int(0, "Kills");
    	PlayerInfo[playerid][pDeaths]                   = cache_get_field_content_int(0, "Deaths");
    	PlayerInfo[playerid][pArrested]                 = cache_get_field_content_int(0, "Arrested");
    	PlayerInfo[playerid][pWantedDeaths]             = cache_get_field_content_int(0, "WantedDeaths");
    	PlayerInfo[playerid][pPhoneBook]                = cache_get_field_content_int(0, "Phonebook");
    	PlayerInfo[playerid][pWantedLevel]              = cache_get_field_content_int(0, "WantedLevel");
    	PlayerInfo[playerid][pFishes]                   = cache_get_field_content_int(0, "Fishes");
    	PlayerInfo[playerid][pJob]                      = cache_get_field_content_int(0, "Job");
    	PlayerInfo[playerid][pPayCheck]                 = cache_get_field_content_int(0, "Paycheck");
    	PlayerInfo[playerid][pHeadValue]                = cache_get_field_content_int(0, "HeadValue");
    	PlayerInfo[playerid][pJailed]                   = cache_get_field_content_int(0, "Jailed");
    	PlayerInfo[playerid][pJailTime]                 = cache_get_field_content_int(0, "JailTime");
    	PlayerInfo[playerid][pMats]                     = cache_get_field_content_int(0, "Materials");
    	PlayerInfo[playerid][pDrugs]                    = cache_get_field_content_int(0, "Drugs");
    	PlayerInfo[playerid][pLeader]                   = cache_get_field_content_int(0, "Leader");
    	PlayerInfo[playerid][pMember]                   = cache_get_field_content_int(0, "Member");
    	PlayerInfo[playerid][pRank]                     = cache_get_field_content_int(0, "Rank");
    	PlayerInfo[playerid][pFACWarns]                 = cache_get_field_content_int(0, "FWarn");
    	PlayerInfo[playerid][pFpunish]                  = cache_get_field_content_int(0, "FPunish");
    	PlayerInfo[playerid][pLawyer]                   = cache_get_field_content_int(0, "Acceptpoints");
    	PlayerInfo[playerid][pFishSkill]                = cache_get_field_content_int(0, "FishSkill");
    	PlayerInfo[playerid][pSpawnChange]              = cache_get_field_content_int(0, "SpawnChange");
 		PlayerInfo[playerid][pRobSkill]                 = cache_get_field_content_int(0, "RobSkill");
    	PlayerInfo[playerid][pTruckSkill]               = cache_get_field_content_int(0, "TruckSkill");
    	PlayerInfo[playerid][pTruckTimes]               = cache_get_field_content_int(0, "TruckTimes");
    	PlayerInfo[playerid][pTruckRem]                 = cache_get_field_content_int(0, "TruckRem");
    	PlayerInfo[playerid][pFarmSkill]                = cache_get_field_content_int(0, "FarmSkill");
    	PlayerInfo[playerid][pFarmTimes]                = cache_get_field_content_int(0, "FarmTimes");
    	PlayerInfo[playerid][pFarmRem]                  = cache_get_field_content_int(0, "FarmRem");
		PlayerInfo[playerid][pPizzaSkill]               = cache_get_field_content_int(0, "PizzaSkill");
    	PlayerInfo[playerid][pPizzaTimes]               = cache_get_field_content_int(0, "PizzaTimes");
    	PlayerInfo[playerid][pPizzaRem]                 = cache_get_field_content_int(0, "PizzaRem");
		PlayerInfo[playerid][pArmsSkill]                = cache_get_field_content_int(0, "ArmsSkill");
		PlayerInfo[playerid][pArmsTimes]                = cache_get_field_content_int(0, "ArmsTimes");
		PlayerInfo[playerid][pArmsRem]                	= cache_get_field_content_int(0, "ArmsRem");
		PlayerInfo[playerid][pBusSkill]                	= cache_get_field_content_int(0, "BusSkill");
		PlayerInfo[playerid][pBusTimes]                	= cache_get_field_content_int(0, "BusTimes");
		PlayerInfo[playerid][pBusRem]                	= cache_get_field_content_int(0, "BusRem");
    	PlayerInfo[playerid][pFishTimes]                = cache_get_field_content_int(0, "FishTimes");
    	PlayerInfo[playerid][pFishRem]                  = cache_get_field_content_int(0, "FishRem");
    	PlayerInfo[playerid][pRobRem]                   = cache_get_field_content_int(0, "RobRem");
    	PlayerInfo[playerid][pRobTimes]                 = cache_get_field_content_int(0, "RobTimes");
    	PlayerInfo[playerid][pHealth]                   = cache_get_field_content_float(0, "pHealth");
    	PlayerInfo[playerid][pInt]                      = cache_get_field_content_int(0, "Inter");
    	PlayerInfo[playerid][pLocal]                    = cache_get_field_content_int(0, "Local");
    	PlayerInfo[playerid][pTeam]                     = cache_get_field_content_int(0, "Team");
    	PlayerInfo[playerid][pModel]                    = cache_get_field_content_int(0, "Model");
    	PlayerInfo[playerid][pPnumber]                  = cache_get_field_content_int(0, "PhoneNr");
    	PlayerInfo[playerid][pPhousekey]                = cache_get_field_content_int(0, "House");
    	PlayerInfo[playerid][pPbiskey]                  = cache_get_field_content_int(0, "Bizz");
    	PlayerInfo[playerid][pPos_x]                    = cache_get_field_content_float(0, "Pos_x");
    	PlayerInfo[playerid][pPos_y]                    = cache_get_field_content_float(0, "Pos_y");
    	PlayerInfo[playerid][pPos_z]                    = cache_get_field_content_float(0, "Pos_z");
    	PlayerInfo[playerid][pRob]                      = cache_get_field_content_int(0, "Rob");
    	PlayerInfo[playerid][pCarLicT]                  = cache_get_field_content_int(0, "CarLicT");
    	PlayerInfo[playerid][pCarLic]                   = cache_get_field_content_int(0, "CarLic");
		PlayerInfo[playerid][pCarLicSuspend]            = cache_get_field_content_int(0, "CarLicSuspend");
		PlayerInfo[playerid][pGunLicSuspend]            = cache_get_field_content_int(0, "GunLicSuspend");
    	PlayerInfo[playerid][pFlyLicT]                  = cache_get_field_content_int(0, "FlyLicT");
    	PlayerInfo[playerid][pFlyLic]                   = cache_get_field_content_int(0, "FlyLic");
    	PlayerInfo[playerid][pBoatLicT]                 = cache_get_field_content_int(0, "BoatLicT");
    	PlayerInfo[playerid][pBoatLic]                  = cache_get_field_content_int(0, "BoatLic");
    	PlayerInfo[playerid][pGunLicT]                  = cache_get_field_content_int(0, "GunLicT");
    	PlayerInfo[playerid][pGunLic]                   = cache_get_field_content_int(0, "GunLic");
    	PlayerInfo[playerid][pPayDay]                   = cache_get_field_content_int(0, "PayDay");
    	PlayerInfo[playerid][pTut]                      = cache_get_field_content_int(0, "Tutorial");
    	PlayerInfo[playerid][pWarns]                    = cache_get_field_content_int(0, "Warnings");
    	PlayerInfo[playerid][pRented]                   = cache_get_field_content_int(0, "Rented");
    	PlayerInfo[playerid][pFuel]                     = cache_get_field_content_int(0, "Fuel");
    	PlayerInfo[playerid][pWTalkie]                  = cache_get_field_content_int(0, "WTalkie");
    	cache_get_field_content(0, "Email", PlayerInfo[playerid][pEmail], SQL, 255);
    	cache_get_field_content(0, "RegisterDate", PlayerInfo[playerid][pRegistredDate], SQL, 255);
    	PlayerInfo[playerid][pClan]                     = cache_get_field_content_int(0, "Clan");
    	PlayerInfo[playerid][pHitT]                     = cache_get_field_content_int(0, "HitT");
    	PlayerInfo[playerid][pCRank]                    = cache_get_field_content_int(0, "CRank");
		PlayerInfo[playerid][pCWarns]                   = cache_get_field_content_int(0, "ClanWarns");
    	PlayerInfo[playerid][pPhone]                    = cache_get_field_content_int(0, "Phone");
    	PlayerInfo[playerid][pSQLID]                    = cache_get_field_content_int(0, "id");
    	PlayerInfo[playerid][pPcarkey]                  = cache_get_field_content_int(0, "Carkey");
    	PlayerInfo[playerid][pmotokey]                  = cache_get_field_content_int(0, "motokey");
    	PlayerInfo[playerid][pprcarkey2]                = cache_get_field_content_int(0, "prcarkey2");
    	PlayerInfo[playerid][pPPluscarkey]              = cache_get_field_content_int(0, "pluscarkey");
    	PlayerInfo[playerid][pPPluscarkey2]             = cache_get_field_content_int(0, "pluscarkey2");
    	PlayerInfo[playerid][pPlusSlot1]                = cache_get_field_content_int(0, "PlusSlot1");
    	PlayerInfo[playerid][pPlusSlot2]                = cache_get_field_content_int(0, "PlusSlot2");
    	PlayerInfo[playerid][phelikey]                  = cache_get_field_content_int(0, "helikey");
    	PlayerInfo[playerid][pprcarkey]                 = cache_get_field_content_int(0, "prcarkey");
    	cache_get_field_content(0, "Victim", PlayerInfo[playerid][pVictim], SQL, 255);
    	cache_get_field_content(0, "Accused", PlayerInfo[playerid][pAccused], SQL, 255);
    	cache_get_field_content(0, "Crime1", PlayerInfo[playerid][pCrime1], SQL, 255);
    	cache_get_field_content(0, "Crime2", PlayerInfo[playerid][pCrime2], SQL, 255);
    	cache_get_field_content(0, "Crime3", PlayerInfo[playerid][pCrime3], SQL, 255);
        PlayerInfo[playerid][pBTemp]                    = cache_get_field_content_int(0, "BTemp");
    	PlayerInfo[playerid][pBYear]                    = cache_get_field_content_int(0, "BYear");
    	PlayerInfo[playerid][pBMonth]                   = cache_get_field_content_int(0, "BMonth");
    	PlayerInfo[playerid][pBDay]                     = cache_get_field_content_int(0, "BDay");
    	cache_get_field_content(0, "BBy", PlayerInfo[playerid][pBBy], SQL, 255);
    	cache_get_field_content(0, "BReason", PlayerInfo[playerid][pBReason], SQL, 255);
    	PlayerInfo[playerid][pStatus]                   = cache_get_field_content_int(0, "Status");
    	PlayerInfo[playerid][pALeader]                  = cache_get_field_content_int(0, "ALeader");
    	PlayerInfo[playerid][pLanguage]                 = cache_get_field_content_int(0, "Language");
    	PlayerInfo[playerid][pClanTag]                  = cache_get_field_content_int(0, "ClanTag");
    	PlayerInfo[playerid][pFWorks]                   = cache_get_field_content_int(0, "FWorks");
    	PlayerInfo[playerid][pVirtualPD]                = cache_get_field_content_int(0, "VirtualPD");
    	PlayerInfo[playerid][pGlasses]                  = cache_get_field_content_int(0, "Glasses");
    	PlayerInfo[playerid][pFactionTime]              = cache_get_field_content_int(0, "FactionTime");
    	PlayerInfo[playerid][pCredits]                  = cache_get_field_content_int(0, "CreditsF");
    	PlayerInfo[playerid][pNMuted]                   = cache_get_field_content_int(0, "NMuted");
    	PlayerInfo[playerid][pHelpedPlayers]            = cache_get_field_content_int(0, "HelpedPlayers");
    	PlayerInfo[playerid][pCommands]                 = cache_get_field_content_int(0, "Commands");
    	PlayerInfo[playerid][pHost]            			= cache_get_field_content_int(0, "Host");
    	PlayerInfo[playerid][pPhoneBlock]            	= cache_get_field_content_int(0, "PhoneBlock");
    	PlayerInfo[playerid][pHiddenColor]            	= cache_get_field_content_int(0, "HiddenColor");
    	PlayerInfo[playerid][pGiftTime]            		= cache_get_field_content_int(0, "GiftTime");
    	PlayerInfo[playerid][pHats]                     = cache_get_field_content_int(0, "Hats");
    	PlayerInfo[playerid][pFightStyle]               = cache_get_field_content_int(0, "FightStyle");
    	PlayerInfo[playerid][pHUD1]               		= cache_get_field_content_int(0, "HUD1");
    	PlayerInfo[playerid][pHUD2]               		= cache_get_field_content_int(0, "HUD2");
    	PlayerInfo[playerid][pHUD3]              	 	= cache_get_field_content_int(0, "HUD3");
		for(new ev=0; ev<50; ev++)
		{
			new strb[30];
			format(strb, sizeof(strb),"Quest%d",ev);
			QEvent[playerid][ev] 						= cache_get_field_content_int(0, strb);
		}
	}
	else
	{
		new stringyy[320],
			loginname[64];
		GetPlayerName(playerid,loginname,sizeof(loginname));
		gPlayerLogTries[playerid] -= 1;
		if(gPlayerLogTries[playerid] == 1 || gPlayerLogTries[playerid] == 0)
		{
			format(stringyy,sizeof(stringyy),"{FF0000}Incorrect password. You have %d remaining login attempts left.", gPlayerLogTries[playerid]);
			SendClientMessage(playerid, COLOR_RED, stringyy);
		}
		ShowPlayerDialog(playerid,DIALOG_LOGIN2,DIALOG_STYLE_PASSWORD,"SERVER: Login","Welcome to the s4uriK RPG Server.\n\nPlease enter your password below!","Login","Cancel");
        if(gPlayerLogTries[playerid] == -1)
		{
		    new stringkick[256];
		    format(stringkick, sizeof(stringkick), "AdmWarn: {FFFFFF}%s has been kicked for entering the wrong password 2 times.",loginname);
		   	ABroadCast(COLOR_RED2,stringkick,1);
			KickEx(playerid);
		}
        return 1;
	}
Reply
#5

Yesterday i could register and login but then when it shows me (Male/Female) or the language (English/Romana) i get crash directly. Some of my friends tried and they got crash too. any one know how to solve this problem??
Reply
#6

Some times i can register and login and some times idk what happen and i can't login after registering and when it works and i log in then after i press login i get crash directly.

Код:
SA-MP 0.3.7
Exception At Address: 0x72746150
Base: 0x03F80000

Registers:
EAX: 0x72746150	EBX: 0x0E3971DC	ECX: 0x0E3971DC	EDX: 0x00863C40
ESI: 0x775D57F0	EDI: 0x0E3971DC	EBP: 0x0029FD4C	ESP: 0x0029FD1C
EFLAGS: 0x00210246

Stack:
+0000: 0x7036190E   0x0000001A   0x03D83AB8   0x0E3971DC
+0010: 0x0029FD14   0x0029FF70   0x67B6334A   0x00000000
+0020: 0x007FE9EA   0x00000018   0x00000014   0x0000001A
+0030: 0x74BF0860   0x70361887   0x0E3971DC   0x0000001A
+0040: 0x03D83AB8   0x74BF0860   0x0029FD78   0x0E3971DC
+0050: 0x00C88224   0x00000009   0x00000000   0x0000001A
+0060: 0x74BF0860   0x00000000   0x00000001   0x00C88224
+0070: 0x44AA0000   0x00000000   0x0053EAC9   0x442A0000
+0080: 0x43C00000   0x0053ECC2   0x00000001   0x00619B71
+0090: 0x0000001A   0x00000001   0x00000001   0x0000000A
+00A0: 0x00748DA0   0x0000001A   0x00000001   0x775C9640
+00B0: 0x00000000   0x0029FF80   0xFFFDF000   0x01720000
+00C0: 0x4E33B2FD   0x01720EC8   0x00000008   0x00000100
+00D0: 0x00000008   0x00000102   0x442A0000   0x43C00000
+00E0: 0x00000000   0x00000000   0x00000550   0x00000300
+00F0: 0x00000000   0x00000001   0x0005026A   0x00000200
+0100: 0x00000000   0x018002A8   0x001FA09E   0x000002A8
+0110: 0x00000180   0x0000002C   0x0029FE24   0x00825EA4
+0120: 0x75277897   0x00825EA4   0x00000000   0xFFFDF000
+0130: 0x00821D17   0x00835342   0xEFE02CC2   0x0029FF80
+0140: 0x008246F1   0x00400000   0x00000000   0x018B2B16
+0150: 0x0000000A   0x00000094   0x00000006   0x00000002
+0160: 0x000023F0   0x00000002   0x00000000   0x00000000
+0170: 0x00000000   0x00000000   0x00000000   0x00000000
+0180: 0x00000000   0x00000000   0x00000000   0x00000000
+0190: 0x00000000   0x00000000   0x00000000   0x00000000
+01A0: 0x00000000   0x00000000   0x00000000   0x00000000
+01B0: 0x00000000   0x00000000   0x00000000   0x00000000
+01C0: 0x00000000   0x00000000   0x00000000   0x00000000
+01D0: 0x00000000   0x00000000   0x00000000   0x00000000
+01E0: 0x00000000   0x00824588   0x00824570   0x00824570
+01F0: 0xFFFDF000   0xC0000005   0x00000000   0x018B2B16
+0200: 0x00000044   0x018C39B0   0x018C1A40   0x018BD7C0
+0210: 0x00000000   0x00000000   0x00000000   0x00000000
+0220: 0x00000000   0x00000000   0x00000000   0x00000000
+0230: 0x00000000   0x00000000   0xFFFFFFFF   0xFFFFFFFF
+0240: 0xFFFFFFFF   0x00000000   0x00000000   0x0029FE70
+0250: 0x0029F75C   0x0029FFCC   0x00825EA4   0x00888078
+0260: 0x00000000   0x0029FF94   0x775C3744   0xFFFDF000
+0270: 0x775C3720   0xD2FEE4A4   0x0029FFDC   0x77789E54

SCM Op: 0x248, lDbg: 0 LastRendObj: 3934

Game Version: US 1.0

State Information: Ped Context: 0
Reply
#7

Is mysql_debug mode is enabled? if yes, then show the debug reports
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)