Login is bugged like hell.
#1

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!!!!!
Reply
#2

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

Код:
	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
Reply
#4

anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)