[Ajuda] Passwords do servidor
#1

Boas pessoal.

Eu tenho tudo direito na pKey, mas se eu nгo meter a password correcta dб para fazer login na mesma.
Serб que alguйm me pode ajudar ?
Reply
#2

Se vocк nгo postar o cуdigo fica dнficil nй amigo?
Reply
#3

Код:
public OnPlayerLogin(playerid,password[])
{
    new string2[128];
	format(string2, sizeof(string2), "GMRP/Accounts/%s.ini", PlayerName(playerid));
	new File: UserFile = fopen(string2, io_read);
	if ( UserFile )
	{
	    new PassData[256];
	    new keytmp[256], valtmp[256];
	    fread( UserFile , PassData , sizeof( PassData ) );
	    keytmp = ini_GetKey( PassData );
	    if( strcmp( keytmp , "Key" , true ) == 0 )
		{
			valtmp = ini_GetValue( PassData );
			strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
		}
		if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
		{
			    new key[ 256 ] , val[ 256 ];
			    new Data[ 256 ];
			    while ( fread( UserFile , Data , sizeof( Data ) ) )
				{
					key = ini_GetKey( Data );
					if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
Код:
public OnPlayerRegister(playerid, password[])
{
	if(IsPlayerConnected(playerid))
	{
			new string3[128];
			format(string3, sizeof(string3), "GMRP/Accounts/%s.ini", PlayerName(playerid));
			new File: hFile = fopen(string3, io_write);
			if (hFile)
			{
			    strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
			    new var[32];
				format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
                PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
Reply
#4

Posta a public OnPlayerLogin completa.
Reply
#5

Pois, assim tornasse difнcil de ajudar.
Reply
#6

Jб consegui resolver o problema.
Obrigado,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)