SA-MP Forums Archive
Login is bugged like hell. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Login is bugged like hell. (/showthread.php?tid=79865)



Login is bugged like hell. - Gamer007 - 31.05.2009

Okay everytime i type /prisijungti and i enter a 1 letter or something that is not my password ex: /prisijungti 32 but my password is like 7658 and it still logins for me i tryed to fix it but i don't know how here's the code;


the login command


Код:
	if (strcmp(cmd, "/prisijungti", true) == 0)
	{
 		new tmppass[128];
		if(AccountInfo[playerid][Prisijunges] == 1) return SendClientMessage(playerid, LIGHTBLUE, "Tu jau esi prisijunges.");
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, LIGHTBLUE, "Naudojimas: /prisijungti [slaptazodis]");
		new plname[MAX_PLAYER_NAME];
  		GetPlayerName(playerid, plname, sizeof(plname));
		format(string, sizeof(string), "/fAccounts/%s.ini", plname);
		if(!fexist(string)) return SendClientMessage(playerid, LIGHTBLUE, "Account'as neregistruotas! Prisiregistruok: /registruotis [slaptazodis]");
		strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
		OnPlayerLogin(playerid, MD5_Hash(tmppass));
		return 1;
	}
OnPlayerLogin callback


Код:
if (!strcmp("Slaptazodis", passres))
		{
			value = GetFileValue(pass);
			strmid(AccountInfo[playerid][Slaptazodis], value, 0, strlen(value)-1, 128);
		}
		else
		{
			SendClientMessage(playerid, LIGHTBLUE, "Neteisingas slaptazodis.");
	    fclose(account);
	    return 1;
		}
sry didn't want to show my onplayerlogin all of it but these are the lines that should show not incorrect password and it should close the account but it still logins for me. Please someone help me!!!!!


Re: Login is bugged like hell. - shitbird - 31.05.2009

i don't understand half of that code, due to that language.


Re: Login is bugged like hell. - Gamer007 - 31.05.2009

Код:
	if (strcmp(cmd, "/prisijungti", true) == 0)
	{
 		new tmppass[128];
		if(AccountInfo[playerid][Prisijunges] == 1) return SendClientMessage(playerid, LIGHTBLUE, "Tu jau esi prisijunges.");
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, LIGHTBLUE, "Naudojimas: /prisijungti [slaptazodis]");
		new plname[MAX_PLAYER_NAME];
  		GetPlayerName(playerid, plname, sizeof(plname));
		format(string, sizeof(string), "/fAccounts/%s.ini", plname);
		if(!fexist(string)) return SendClientMessage(playerid, LIGHTBLUE, "Account'as neregistruotas! Prisiregistruok: /registruotis [slaptazodis]");
		strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
		OnPlayerLogin(playerid, MD5_Hash(tmppass));
		return 1;
	}
Код:
if(!strlen(tmp)) return SendClientMessage(playerid, LIGHTBLUE, "Naudojimas: /prisijungti [slaptazodis]");
this is usage...

Код:
if(AccountInfo[playerid][Prisijunges] == 1) return SendClientMessage(playerid, LIGHTBLUE, "Tu jau esi prisijunges.");
player is already logged it


Код:
if(!fexist(string)) return SendClientMessage(playerid, LIGHTBLUE, "Account'as neregistruotas! Prisiregistruok: /registruotis [slaptazodis]");
the player isn't registered

Код:
if (!strcmp("Slaptazodis", passres))
		{
			value = GetFileValue(pass);
			strmid(AccountInfo[playerid][Slaptazodis], value, 0, strlen(value)-1, 128);
		}
		else
		{
			SendClientMessage(playerid, LIGHTBLUE, "Neteisingas slaptazodis.");
	    fclose(account);
	    return 1;
		}
Slaptazodis = password
Код:
SendClientMessage(playerid, LIGHTBLUE, "Neteisingas slaptazodis.");
incorrect pw


Re: Login is bugged like hell. - Gamer007 - 01.06.2009

anyone?