bug logueo y registro
#1

no se si esto pueda colocarlo aca de no ser asi por favor diganme donde puedo colocarlo.

buenas, gracias de antemano a quien pueda ayudarme.

bueno el problema que tengo es el siguiente: abro mi server va todo bien entro con un nombre cualquiera y me sale para registrarme perfectamente pero cuando cambio el nombre y intento entrar de nuevo me presenta el error que es despues que pongo la contraseсa que tendra la cuenta nuevo no me salen los dialogos respectivos si no que me toma los mismo datos de la cuenta anteriormente creada, creo que el problema se presenta es al momento de poner la contraseсa y esa parte es esta:

Код:
public LogearJugador(playerid,inputtext[])
{
        new string3[64];
	new NombreJugador3[MAX_PLAYER_NAME];
	new playernamesplit[3][MAX_PLAYER_NAME];
        GetPlayerName(playerid, NombreJugador3, sizeof(NombreJugador3));
	split(NombreJugador3, playernamesplit, '_');
	format(string3, sizeof(string3), "Cuentas/%s.ini", NombreJugador3);
	new File: UserFile = fopen(string3, io_read);
	if ( UserFile )
	{
	    new PassData[256];
	    new keytmp[256], valtmp[256];
	    fread( UserFile , PassData , sizeof( PassData ) );
	    keytmp = ini_GetKey( PassData );
	    if( strcmp( keytmp , "Clave" , true ) == 0 )
		{
			valtmp = ini_GetValue( PassData );
			strmid(InfoJugador[playerid][jClave], valtmp, 0, strlen(valtmp)-1, 255);
		}
		if(strcmp(InfoJugador[playerid][jClave],inputtext, true ) == 0)
		{
			    new key[ 256 ] , val[ 256 ];
			    new Data[ 256 ];
			    while ( fread( UserFile , Data , sizeof( Data ) ) )
				{
				key = ini_GetKey( Data );
			        if( strcmp( key , "AdminNvl" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jAdminNvl] = strval( val ); }
			        if( strcmp( key , "Sexo" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jSexo] = strval( val ); }
			        if( strcmp( key , "Edad" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jEdad] = strval( val ); }
			        if( strcmp( key , "Ropa" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jRopa] = strval( val ); }
                                if( strcmp( key , "Vida" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jVida] = floatstr( val ); }
			        if( strcmp( key , "Armadura" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jArmadura] = floatstr( val ); }
           			if( strcmp( key , "Mascara" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jMascara] = strval( val ); }
			        if( strcmp( key , "Pos_x" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jPos_x] = floatstr( val ); }
			        if( strcmp( key , "Pos_y" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jPos_y] = floatstr( val ); }
			        if( strcmp( key , "Pos_z" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jPos_z] = floatstr( val ); }
		         	if( strcmp( key , "Interior" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jInterior] = strval( val ); }
			        if( strcmp( key , "MundoVirtual" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jMundoVirtual] = strval( val ); }
			        if( strcmp( key , "Registrado" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jRegistrado] = strval( val ); }
			        if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jLevel] = strval( val ); }
			        if( strcmp( key , "Experiencia" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jExp] = strval( val ); }
				/*ResetPlayerMoney(playerid);
				GivePlayerMoney(playerid,InfoJugador[playerid][jDinero]);
			        if( strcmp( key , "Dinero" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jDinero] = strval( val ); }*/
			        /*if( strcmp( key , "TiempoConectado" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jConnectTime] = strval( val ); }
			        if( strcmp( key , "Banco" , true ) == 0 ) { val = ini_GetValue( Data ); InfoJugador[playerid][jBanco] = strval( val ); }*/
			    }
		                SpawnPlayer(playerid);
				fclose(UserFile);
		}
		else
		{
				new loginstring[128];
				new loginname[64];
				GetPlayerName(playerid,loginname,sizeof(loginname));
				format(loginstring,sizeof(loginstring),"{FFFFFF}Servidor: Contraseсa Incorrecta\n{FFFFFF}Coloca Bien Tu {6600FF}Contraseсa.");
				ShowPlayerDialog(playerid,DIALOGO_INGRESO,DIALOG_STYLE_INPUT,"{00FFFF}[GM]Base Roleplay",loginstring,"Entrar","Salir");
		                fclose(UserFile);
		                IntentosdeIngreso[playerid] += 1;
				if(IntentosdeIngreso[playerid] == 5) { Ban(playerid); }
		         return 1;
		}
 	}
			if(InfoJugador[playerid][jRegistrado] == 0)
    			{
      			ShowPlayerDialog(playerid, DIALOGO_SEXO, DIALOG_STYLE_MSGBOX, "- Sexo -","їQuй gйnero eres?","Hombre","Mujer");
				}
	        return 1;
}
de verdad quien pueda ayudarme por favor.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)