SA-MP Forums Archive
Help ncryption mysql r7 SH1 - 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)
+--- Thread: Help ncryption mysql r7 SH1 (/showthread.php?tid=629997)



Help ncryption mysql r7 SH1 - Tirael - 06.03.2017

Hello, I am trying to make a system that encrypts passwords in SHA1.
I did this:

Register:

pawn Код:
format(Query, sizeof(Query), "INSERT INTO `usuarios` (Nombre, Password) VALUES ('%s', SHA1('%s'))",pName, PlayerInfo[playerid][pKey]);
                    mysql_function_query(ConexionDB, Query, true, "OnQueryFinish", "ii", 0, playerid);
                    format(string, sizeof(string), "Has registrado el personaje %s en nuestro servidor.\n\nAhora inicia sesiуn", pName);
                    ShowPlayerDialog(playerid, DialogInicio, DIALOG_STYLE_PASSWORD,"Iniciar sesiуn",string,"Enviar","Salir");



Login not found:

pawn Код:
case DialogInicio:
        {
            if(!response)
            {
                MotivoExpulsado(playerid, 3);
                return 1;
            }
            if(PassValida(playerid, inputtext) && (strlen(inputtext) > 0))
            {
                if(strcmp(PlayerInfo[playerid][pKey], inputtext, true, 128) == 0)
                {
                    printf("inputtext %s", inputtext);
                    if(strlen(inputtext) >= 1)
                    {
                        format(Query, sizeof(Query), "SELECT * FROM `usuarios` WHERE `Nombre` = '%s'", pName);
                        mysql_function_query(ConexionDB, Query, true, "OnQueryFinish", "ii", 1, playerid);
                        printf("Query %s", Query);
                        SendClientMessage(playerid, -1, "Clave correcta");
                    }
                    else
                    {
                        SendClientMessage(playerid, -1, "ї Si no escribes una contraseсa como narices vas a entrar ?.");
                        if(IntentosEntradaClaveErronea[playerid] > 2)
                        {
                            MotivoExpulsado(playerid, 4);
                            return 1;
                        }
                        format(string, sizeof(string), "Contraseсa Incorrecta.\nTe quedan %d/3 intentos", IntentosEntradaClaveErronea[playerid], pName);
                        ShowPlayerDialog(playerid, DialogInicio, DIALOG_STYLE_PASSWORD,"Iniciar sesiуn",string,"Enviar","Salir");
                        IntentosEntradaClaveErronea[playerid] ++;
                        return 1;
                    }
                }
                else
                {
                    print("INCORRECTA");
                    ShowInfoForPlayer(playerid, "~w~ЎCONTRASEСA ~r~INCORRECTA", 3000);
                    format(string, sizeof(string), "Contraseсa Incorrecta.\nTe quedan %d/3 intentos", IntentosEntradaClaveErronea[playerid], pName);
                    ShowPlayerDialog(playerid, DialogInicio, DIALOG_STYLE_PASSWORD,"Iniciar sesiуn",string,"Enviar","Salir");
                    IntentosEntradaClaveErronea[playerid] ++;
                    return 1;
                }
            }

            return 1;
        }
Funtion:
pawn Код:
funcion PassValida(playerid, cadena[])
{
//  if(IsValidNPC(playerid)) return 1;
    new query[1024];
   
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(query, sizeof(query),"SELECT * FROM usuarios WHERE Nombre = '%s' AND Password = SHA1('%s') LIMIT 1",name, cadena);
    mysql_function_query(ConexionDB, query, true, "OnQueryFinish", "ii", 0, playerid);
    printf("name %s - Clave %s", name, cadena);
    printf("Password %s", name, cadena);
 

    return 1;
}



Encryption works fine but never validates the key. Someone help me ?
+ rep To help me.


Re: Help ncryption mysql r7 SH1 - [WSF]ThA_Devil - 06.03.2017

You don't need to decrypt the password. (That is an awful practice). When you're checking for the password if it is right, you hash the password that player has put in (dialog or whatever) and then compare it to what you have in database.


Respuesta: Re: Help ncryption mysql r7 SH1 - Tirael - 06.03.2017

Quote:
Originally Posted by [WSF]ThA_Devil
Посмотреть сообщение
You don't need to decrypt the password. (That is an awful practice). When you're checking for the password if it is right, you hash the password that player has put in (dialog or whatever) and then compare it to what you have in database.
Viewing my code can you give me an example?.


Re: Respuesta: Re: Help ncryption mysql r7 SH1 - [WSF]ThA_Devil - 06.03.2017

Quote:
Originally Posted by Tirael
Посмотреть сообщение
Viewing my code can you give me an example?.
It's quite difficult to read non-english scripts due to well... them not being in English.

You're using threaded queries. I suppose you don't know how they do work.
Код:
mysql_function_query(ConexionDB, Query, true, "OnQueryFinish", "ii", 0, playerid);
There's "OnQueryFinish" which is a public function which is called once that query is completed. That's where you should check if the password is correct or wrong.


And why would you possibly only return 1; in PassValida(playerid, cadena[]). If that is your function for validating passwords, it always returns "true"

Learn to do threaded queries or go back to MySQL R6.


Re: Respuesta: Re: Help ncryption mysql r7 SH1 - Toroi - 06.03.2017

Quote:
Originally Posted by Tirael
Посмотреть сообщение
Viewing my code can you give me an example?.
Quote:

Viewing my code

Quote:
MY CODE
Heh, that's funny.


Respuesta: Help ncryption mysql r7 SH1 - Tirael - 07.03.2017

I got it to recognize the encryption and yes the correct key or not but now my problem is that it does not load the accounts, but does not load it.

Code:

pawn Код:
if(PassValida(playerid, inputtext) && (strlen(inputtext) > 0))
            {
                SendClientMessage(playerid, -1, "Pass ok");
                return 1;
            }
            else
            {
                format(string, sizeof(string), "Contraseсa Incorrecta.\nTe quedan %d/3 intentos", IntentosEntradaClaveErronea[playerid], pName);
                ShowPlayerDialog(playerid, DialogInicio, DIALOG_STYLE_PASSWORD,"Iniciar sesiуn",string,"Enviar","Salir");
                IntentosEntradaClaveErronea[playerid] ++;
            }
Function:

pawn Код:
funcion PassValida(playerid, cadena[])
{
//  if(IsValidNPC(playerid)) return 1;
    new name[MAX_PLAYER_NAME],rows;
    GetPlayerName(playerid, name, sizeof(name));
    format(Query, sizeof(Query),"SELECT * FROM usuarios WHERE Nombre = '%s' AND Password = SHA1('%s') LIMIT 1",name, cadena);
    mysql_function_query(ConexionDB, Query, true, "OnQueryFinish", "ii", SIN_RESULTADO, playerid);
    printf("name %s - Clave %s", name, cadena);
    printf("Password %s", cadena);
    if(mysql_num_rows(rows) != 0)
    {
        format(Query, sizeof(Query), "SELECT * FROM `usuarios` WHERE `Nombre` = '%s'", name);
        mysql_function_query(ConexionDB, Query, true, "OnQueryFinish", "ii", 1, playerid);
        return 1;
    }

    return 0;
}
Load accounts:

pawn Код:
case 1:
        {
            if(Rows == 1)
            {
                new content[20];
                cache_get_field_content(0, "Password", content); PlayerInfo[extraid][pKey] = strval(content);
                printf("Password %s", content);
                printf("Password %s", PlayerInfo[extraid][pKey]);
                cache_get_field_content(0, "Admin", content);   PlayerInfo[extraid][pAdmin] = strval(content);
                printf("Admin %d", content);
                cache_get_field_content(0, "VIP", content); PlayerInfo[extraid][pVipNivel] = strval(content);
                printf("VIP %d", content);
                cache_get_field_content(0, "Money", content); PlayerInfo[extraid][pDineroMano] = strval(content);
                printf("Money %d", content);
                cache_get_field_content(0, "MoneyBanco", content); PlayerInfo[extraid][pDineroBanco] = strval(content);
                printf("MoneyBanco %d", content);
                cache_get_field_content(0, "Score", content); PlayerInfo[extraid][pNivel] = strval(content);
                printf("Score %d", content);
                cache_get_field_content(0, "PosX", content); PlayerInfo[extraid][pLoadPosX] = floatstr(content);
                printf("PosX %f", content);
                cache_get_field_content(0, "PosY", content); PlayerInfo[extraid][pLoadPosY] = floatstr(content);
                printf("PosY %f", content);
                cache_get_field_content(0, "PosZ", content); PlayerInfo[extraid][pLoadPosZ] = floatstr(content);
                printf("PosZ %f", content);
                cache_get_field_content(0, "Nivel", content); PlayerInfo[extraid][pNivel] = strval(content);
                cache_get_field_content(0, "Registrado", content); PlayerInfo[extraid][pRegistrado] = strval(content);
                cache_get_field_content(0, "Tutorial", content); PlayerInfo[extraid][pTutorial] = strval(content);
                cache_get_field_content(0, "Sexo", content); PlayerInfo[extraid][pSexo] = strval(content);
                cache_get_field_content(0, "Edad", content); PlayerInfo[extraid][pEdad] = strval(content);
                cache_get_field_content(0, "Experiencia", content); PlayerInfo[extraid][pExperiencia] = strval(content);
                cache_get_field_content(0, "Skin", content); PlayerInfo[extraid][pSkin] = strval(content);
                cache_get_field_content(0, "Coche1", content); PlayerInfo[extraid][pLlaveCoche] = strval(content);
                cache_get_field_content(0, "Coche2", content); PlayerInfo[extraid][pLlaveCoche2] = strval(content);
                cache_get_field_content(0, "Coche3", content); PlayerInfo[extraid][pLlaveCoche3] = strval(content);
                cache_get_field_content(0, "Coche4", content); PlayerInfo[extraid][pLlaveCoche4] = strval(content);
                cache_get_field_content(0, "Coche5", content); PlayerInfo[extraid][pLlaveCoche5] = strval(content);
                cache_get_field_content(0, "Crimenes", content); PlayerInfo[extraid][pCrimenes] = strval(content);
                cache_get_field_content(0, "Muertes", content); PlayerInfo[extraid][pMuertes] = strval(content);
                cache_get_field_content(0, "Arrestos", content); PlayerInfo[extraid][pArrestos] = strval(content);
                cache_get_field_content(0, "Trabajo", content); PlayerInfo[extraid][pTrabajo] = strval(content);
                cache_get_field_content(0, "TiempoContrato", content); PlayerInfo[extraid][pTiempoContrato] = strval(content);
                cache_get_field_content(0, "HorasJugadas", content); PlayerInfo[extraid][pHorasJugadas] = strval(content);
                cache_get_field_content(0, "PagoEnPayday", content); PlayerInfo[extraid][pPagoEnPayday] = strval(content);
                cache_get_field_content(0, "Faccion", content); PlayerInfo[extraid][pFaccion] = strval(content);
                cache_get_field_content(0, "Rango", content); PlayerInfo[extraid][pRango] = strval(content);
                cache_get_field_content(0, "LlaveCasa", content); PlayerInfo[extraid][pLlaveCasa] = strval(content);
                cache_get_field_content(0, "LlaveCasa2", content); PlayerInfo[extraid][pLlaveCasa2] = strval(content);
                cache_get_field_content(0, "LlaveCasa3", content); PlayerInfo[extraid][pLlaveCasa3] = strval(content);
                cache_get_field_content(0, "LlaveCasa4", content); PlayerInfo[extraid][pLlaveCasa4] = strval(content);
                cache_get_field_content(0, "LlaveCasa5", content); PlayerInfo[extraid][pLlaveCasa5] = strval(content);
                cache_get_field_content(0, "Negocio1", content); PlayerInfo[extraid][pLlaveNegocio1] = strval(content);
                cache_get_field_content(0, "Negocio2", content); PlayerInfo[extraid][pLlaveNegocio2] = strval(content);
                cache_get_field_content(0, "Negocio3", content); PlayerInfo[extraid][pLlaveNegocio3] = strval(content);
                cache_get_field_content(0, "Advertencias", content); PlayerInfo[extraid][pAdvertencias] = strval(content);
                cache_get_field_content(0, "LicenciaConducir", content); PlayerInfo[extraid][pLicenciaConducir] = strval(content);
                cache_get_field_content(0, "LicenciaVuelo", content); PlayerInfo[extraid][pLicenciaVuelo] = strval(content);
                cache_get_field_content(0, "LicenciaArmas", content); PlayerInfo[extraid][pLicenciaArmas] = strval(content);
                cache_get_field_content(0, "LicenciaPesca", content); PlayerInfo[extraid][pLicenciaPesca] = strval(content);
                cache_get_field_content(0, "LicenciaBarco", content); PlayerInfo[extraid][pLicenciaBarco] = strval(content);
                cache_get_field_content(0, "NumeroTelefono", content); PlayerInfo[extraid][pPhoneNumber] = strval(content);
                cache_get_field_content(0, "TieneTelefono", content); PlayerInfo[extraid][pPhoneC] = strval(content);
                cache_get_field_content(0, "NumeroLoteria", content); PlayerInfo[extraid][pNumeroLoteria] = strval(content);
                cache_get_field_content(0, "Encarcelado", content); PlayerInfo[extraid][pEncarcelado] = strval(content);
                cache_get_field_content(0, "TiempoCarcel", content); PlayerInfo[extraid][pTiempoCarcel] = strval(content);
                cache_get_field_content(0, "HeadValue", content); PlayerInfo[extraid][pHeadValue] = strval(content);
                cache_get_field_content(0, "Hospital", content); PlayerInfo[extraid][pHospital] = strval(content);
                cache_get_field_content(0, "EsperandoRefuerzos", content); PlayerInfo[extraid][pEsperandoRefuerzos] = strval(content);
                cache_get_field_content(0, "Interior", content); PlayerInfo[extraid][pLoadPosInt] = strval(content);
                cache_get_field_content(0, "Virtual", content); PlayerInfo[extraid][pLoadPosW] = strval(content);
                cache_get_field_content(0, "CargarPos", content); PlayerInfo[extraid][pLoadPos] = strval(content);
                cache_get_field_content(0, "CuentaBloqueada", content); PlayerInfo[extraid][pCuentaBloqueada] = strval(content);
                cache_get_field_content(0, "LlaveGaraje", content); PlayerInfo[extraid][pGaraje] = strval(content);
                cache_get_field_content(0, "EnCasa", content); PlayerInfo[extraid][pEnCasa] = strval(content);
                cache_get_field_content(0, "EnNegocio", content); PlayerInfo[extraid][pEnNegocio] = strval(content);
                cache_get_field_content(0, "Dni", content); PlayerInfo[extraid][pDni] = strval(content);
                cache_get_field_content(0, "Regalo", content); PlayerInfo[extraid][pRegalo] = strval(content);
                cache_get_field_content(0, "NivelBusqueda", content); PlayerInfo[extraid][pNivelBusqueda] = strval(content);
                cache_get_field_content(0, "Radio", content); PlayerInfo[extraid][pRadio] = strval(content);
                cache_get_field_content(0, "VipDia", content); PlayerInfo[extraid][pVipDia] = strval(content);
                cache_get_field_content(0, "VipMes", content); PlayerInfo[extraid][pVipMes] = strval(content);
                cache_get_field_content(0, "VipAno", content); PlayerInfo[extraid][pVipAno] = strval(content);
                cache_get_field_content(0, "SeguroMedico", content); PlayerInfo[extraid][pSeguroMedico] = strval(content);
                cache_get_field_content(0, "Practicas", content); PlayerInfo[extraid][pPracticas] = strval(content);
                cache_get_field_content(0, "Estilo", content); PlayerInfo[extraid][pEstilo] = strval(content);
                cache_get_field_content(0, "PuntosDeRol", content); PlayerInfo[extraid][pPuntosDeRol] = strval(content);
                cache_get_field_content(0, "VidaGuardada", content); PlayerInfo[extraid][pVidaGuardada] = floatstr(content);
                cache_get_field_content(0, "ChalecoGuardado", content); PlayerInfo[extraid][pChalecoGuardado] = floatstr(content);
                cache_get_field_content(0, "TiempoJugado", content); PlayerInfo[extraid][TiempoJugado] = strval(content);
                cache_get_field_content(0, "Materiales", content); PlayerInfo[extraid][pMateriales] = strval(content);
                cache_get_field_content(0, "Seteo", content); PlayerInfo[extraid][pSeteo] = strval(content);
                cache_get_field_content(0, "InformeMedico", content); PlayerInfo[extraid][pInformeMedico] = strval(content);
                cache_get_field_content(0, "RecuperarCuenta", content); PlayerInfo[extraid][pRecuperarCuenta] = strval(content);
                cache_get_field_content(0, "Origen", content); PlayerInfo[extraid][pOrigen] = strval(content);
                cache_get_field_content(0, "Cansancio", content); PlayerInfo[extraid][pCansancio] = strval(content);
                cache_get_field_content(0, "Atracado", content); PlayerInfo[extraid][pAtracado] = strval(content);
                cache_get_field_content(0, "Encargados", content); PlayerInfo[extraid][pEncargados] = strval(content);
                cache_get_field_content(0, "ObtenerCertificado", content); PlayerInfo[extraid][pObtenerCertificado] = strval(content);
                cache_get_field_content(0, "CiervosMuertos", content); PlayerInfo[extraid][pCiervosMuertos] = strval(content);
                cache_get_field_content(0, "Crasheado", content); PlayerInfo[extraid][pCrasheado] = strval(content);
                cache_get_field_content(0, "EstaEnGaraje", content); PlayerInfo[extraid][pEstaEnGaraje] = strval(content);
                cache_get_field_content(0, "LlaveNegocioCedida", content); PlayerInfo[extraid][pLlaveNegocioCedida] = strval(content);
                cache_get_field_content(0, "EnMotel", content); PlayerInfo[extraid][pEnMotel] = strval(content);
                cache_get_field_content(0, "Fuerza", content); PlayerInfo[extraid][pFuerza] = strval(content);
                cache_get_field_content(0, "RadioMusica", content); PlayerInfo[extraid][pRadioMusica] = strval(content);

                cache_get_field_content(0, "Bolsillo1", content); PlayerInfo[extraid][pBolsillos][0] = strval(content);
                cache_get_field_content(0, "Cantidad1", content); PlayerInfo[extraid][pCantidadBolsillos][0] = strval(content);
                cache_get_field_content(0, "Bolsillo2", content); PlayerInfo[extraid][pBolsillos][1] = strval(content);
                cache_get_field_content(0, "Cantidad2", content); PlayerInfo[extraid][pCantidadBolsillos][1] = strval(content);
                cache_get_field_content(0, "Bolsillo3", content); PlayerInfo[extraid][pBolsillos][2] = strval(content);
                cache_get_field_content(0, "Cantidad3", content); PlayerInfo[extraid][pCantidadBolsillos][2] = strval(content);
                cache_get_field_content(0, "Bolsillo4", content); PlayerInfo[extraid][pBolsillos][3] = strval(content);
                cache_get_field_content(0, "Cantidad4", content); PlayerInfo[extraid][pCantidadBolsillos][3] = strval(content);
                cache_get_field_content(0, "Bolsillo5", content); PlayerInfo[extraid][pBolsillos][4] = strval(content);
                cache_get_field_content(0, "Cantidad5", content); PlayerInfo[extraid][pCantidadBolsillos][4] = strval(content);
                cache_get_field_content(0, "Bolsillo6", content); PlayerInfo[extraid][pBolsillos][5] = strval(content);
                cache_get_field_content(0, "Cantidad6", content); PlayerInfo[extraid][pCantidadBolsillos][5] = strval(content);
                cache_get_field_content(0, "Bolsillo7", content); PlayerInfo[extraid][pBolsillos][6] = strval(content);
                cache_get_field_content(0, "Cantidad7", content); PlayerInfo[extraid][pCantidadBolsillos][6] = strval(content);
                cache_get_field_content(0, "Bolsillo8", content); PlayerInfo[extraid][pBolsillos][7] = strval(content);
                cache_get_field_content(0, "Cantidad8", content); PlayerInfo[extraid][pCantidadBolsillos][7] = strval(content);
                cache_get_field_content(0, "Bolsillo9", content); PlayerInfo[extraid][pBolsillos][8] = strval(content);
                cache_get_field_content(0, "Cantidad9", content); PlayerInfo[extraid][pCantidadBolsillos][8] = strval(content);
                cache_get_field_content(0, "Bolsillo10", content); PlayerInfo[extraid][pBolsillos][9] = strval(content);
                cache_get_field_content(0, "Cantidad10", content); PlayerInfo[extraid][pCantidadBolsillos][9] = strval(content);
                cache_get_field_content(0, "Bolsillo11", content); PlayerInfo[extraid][pBolsillos][10] = strval(content);
                cache_get_field_content(0, "Cantidad11", content); PlayerInfo[extraid][pCantidadBolsillos][10] = strval(content);
                cache_get_field_content(0, "Bolsillo12", content); PlayerInfo[extraid][pBolsillos][11] = strval(content);
                cache_get_field_content(0, "Cantidad12", content); PlayerInfo[extraid][pCantidadBolsillos][11] = strval(content);
                cache_get_field_content(0, "Bolsillo13", content); PlayerInfo[extraid][pBolsillos][12] = strval(content);
                cache_get_field_content(0, "Cantidad13", content); PlayerInfo[extraid][pCantidadBolsillos][12] = strval(content);
                cache_get_field_content(0, "NumRegistro", content); PlayerInfo[extraid][pNumRegistro] = strval(content);
                cache_get_field_content(0, "CasaAlquilada", content); PlayerInfo[extraid][pLlaveCasaAlquiler] = strval(content);
                cache_get_field_content(0, "ArmasRecogidas1", content); PlayerInfo[extraid][pArmasRecogidas][0] = strval(content);
                cache_get_field_content(0, "ArmasRecogidas2", content); PlayerInfo[extraid][pArmasRecogidas][1] = strval(content);
                cache_get_field_content(0, "ArmasRecogidas3", content); PlayerInfo[extraid][pArmasRecogidas][2] = strval(content);
                cache_get_field_content(0, "ArmasRecogidas4", content); PlayerInfo[extraid][pArmasRecogidas][3] = strval(content);
                cache_get_field_content(0, "ArmasRecogidas5", content); PlayerInfo[extraid][pArmasRecogidas][4] = strval(content);
                cache_get_field_content(0, "ArmasRecogidas6", content); PlayerInfo[extraid][pArmasRecogidas][5] = strval(content);
                cache_get_field_content(0, "ArmasRecogidas7", content); PlayerInfo[extraid][pArmasRecogidas][6] = strval(content);
                cache_get_field_content(0, "ArmasRecogidas8", content); PlayerInfo[extraid][pArmasRecogidas][7] = strval(content);
                cache_get_field_content(0, "ArmasRecogidas9", content); PlayerInfo[extraid][pArmasRecogidas][8] = strval(content);
                cache_get_field_content(0, "ArmasRecogidas10", content); PlayerInfo[extraid][pArmasRecogidas][9] = strval(content);
                cache_get_field_content(0, "IdiomaAleman", content); PlayerInfo[extraid][pIdiomas][0] = strval(content);
                cache_get_field_content(0, "IdiomaArabe", content); PlayerInfo[extraid][pIdiomas][1] = strval(content);
                cache_get_field_content(0, "IdiomaChino", content); PlayerInfo[extraid][pIdiomas][2] = strval(content);
                cache_get_field_content(0, "IdiomaEspanol", content); PlayerInfo[extraid][pIdiomas][3] = strval(content);
                cache_get_field_content(0, "IdiomaFrances", content); PlayerInfo[extraid][pIdiomas][4] = strval(content);
                cache_get_field_content(0, "IdiomaItaliano", content); PlayerInfo[extraid][pIdiomas][5] = strval(content);
                cache_get_field_content(0, "IdiomaJapones", content); PlayerInfo[extraid][pIdiomas][6] = strval(content);
                cache_get_field_content(0, "IdiomaPortugues", content); PlayerInfo[extraid][pIdiomas][7] = strval(content);
                cache_get_field_content(0, "IdiomaRuso", content); PlayerInfo[extraid][pIdiomas][8] = strval(content);
                cache_get_field_content(0, "YaEstudio", content); PlayerInfo[extraid][pYaEstudio] = strval(content);
                cache_get_field_content(0, "Email", content); PlayerInfo[extraid][pEmail] = strval(content);
                cache_get_field_content(0, "Duty", content); PlayerInfo[extraid][pDuty] = strval(content);
                cache_get_field_content(0, "BanDuda", content); PlayerInfo[extraid][pBanChats][0] = strval(content);
                cache_get_field_content(0, "BanAD", content); PlayerInfo[extraid][pBanChats][1] = strval(content);
                cache_get_field_content(0, "BanReportar", content); PlayerInfo[extraid][pBanChats][2] = strval(content);
                cache_get_field_content(0, "BanN", content); PlayerInfo[extraid][pBanChats][3] = strval(content);
                cache_get_field_content(0, "CasaPrestada1", content); PlayerInfo[extraid][pLlaveCasaPrestada][0] = strval(content);
                cache_get_field_content(0, "CasaPrestada2", content); PlayerInfo[extraid][pLlaveCasaPrestada][1] = strval(content);
                cache_get_field_content(0, "CasaPrestada3", content); PlayerInfo[extraid][pLlaveCasaPrestada][2] = strval(content);
                cache_get_field_content(0, "CasaPrestada4", content); PlayerInfo[extraid][pLlaveCasaPrestada][3] = strval(content);
                cache_get_field_content(0, "CasaPrestada5", content); PlayerInfo[extraid][pLlaveCasaPrestada][4] = strval(content);
                cache_get_field_content(0, "Casado", content); PlayerInfo[extraid][pCasado] = strval(content);
                cache_get_field_content(0, "CasadoCon", content); PlayerInfo[extraid][pCasadoCon] = strval(content);
                cache_get_field_content(0, "AdvertenciasAnticheats", content); PlayerInfo[extraid][pAdvertenciasAnticheats] = strval(content);
                cache_get_field_content(0, "HabitacionMotel", content); PlayerInfo[extraid][pHabitacionMotel] = strval(content);
                cache_get_field_content(0, "EstudioAleman", content); PlayerInfo[extraid][pIdiomasEstudiados][0] = strval(content);
                cache_get_field_content(0, "EstudioArabe", content); PlayerInfo[extraid][pIdiomasEstudiados][1] = strval(content);
                cache_get_field_content(0, "EstudioChino", content); PlayerInfo[extraid][pIdiomasEstudiados][2] = strval(content);
                cache_get_field_content(0, "EstudioEspanol", content); PlayerInfo[extraid][pIdiomasEstudiados][3] = strval(content);
                cache_get_field_content(0, "EstudioFrances", content); PlayerInfo[extraid][pIdiomasEstudiados][4] = strval(content);
                cache_get_field_content(0, "EstudioItaliano", content); PlayerInfo[extraid][pIdiomasEstudiados][5] = strval(content);
                cache_get_field_content(0, "EstudioJapones", content); PlayerInfo[extraid][pIdiomasEstudiados][6] = strval(content);
                cache_get_field_content(0, "EstudioPortugues", content); PlayerInfo[extraid][pIdiomasEstudiados][7] = strval(content);
                cache_get_field_content(0, "EstudioRuso", content); PlayerInfo[extraid][pIdiomasEstudiados][8] = strval(content);
                cache_get_field_content(0, "ObjetoMochila1", content); PlayerInfo[extraid][pObjetoMochila][0] = strval(content);
                cache_get_field_content(0, "ObjetoMochila2", content); PlayerInfo[extraid][pObjetoMochila][1] = strval(content);
                cache_get_field_content(0, "ObjetoMochila3", content); PlayerInfo[extraid][pObjetoMochila][2] = strval(content);
                cache_get_field_content(0, "ObjetoMochila4", content); PlayerInfo[extraid][pObjetoMochila][3] = strval(content);
                cache_get_field_content(0, "ObjetoMochila5", content); PlayerInfo[extraid][pObjetoMochila][4] = strval(content);
                cache_get_field_content(0, "CantidadMochila1", content); PlayerInfo[extraid][pCantidadMochila][0] = strval(content);
                cache_get_field_content(0, "CantidadMochila2", content); PlayerInfo[extraid][pCantidadMochila][1] = strval(content);
                cache_get_field_content(0, "CantidadMochila3", content); PlayerInfo[extraid][pCantidadMochila][2] = strval(content);
                cache_get_field_content(0, "CantidadMochila4", content); PlayerInfo[extraid][pCantidadMochila][3] = strval(content);
                cache_get_field_content(0, "CantidadMochila5", content); PlayerInfo[extraid][pCantidadMochila][4] = strval(content);
                SetSpawnInfo(extraid,0,0, PlayerInfo[extraid][pLoadPosX],PlayerInfo[extraid][pLoadPosY],PlayerInfo[extraid][pLoadPosZ],0.0,0,0,0,0,0,0);
                LoguearJugador(extraid);
                /*SetPlayerScore(extraid,  PlayerInfo[extraid][pNivel = strval(content);
                SetPlayerArmour(extraid, PlayerInfo[extraid][pChalecoGuardado = strval(content);
                SetPlayerHealth(extraid, PlayerInfo[extraid][pVidaGuardada = strval(content);
  */
       }
            else if(!Rows)
            {

               //aquiiiiiiii
            }
Console:

Код:
[22:03:58] Password NULL
[22:03:58] Password 
[22:03:58] Admin 78
[22:03:58] VIP 78
[22:03:58] Money 78
[22:03:58] MoneyBanco 78
[22:03:58] Score 78
[22:03:58] PosX 0.000000
[22:03:58] PosY 0.000000
[22:03:58] PosZ 0.000000
[22:03:58] -----------------
[22:03:58] LoguearJugador
[22:03:58] -----------------



Respuesta: Re: Respuesta: Re: Help ncryption mysql r7 SH1 - Tirael - 08.03.2017

Quote:
Originally Posted by [WSF]ThA_Devil
Посмотреть сообщение
It's quite difficult to read non-english scripts due to well... them not being in English.

You're using threaded queries. I suppose you don't know how they do work.
Код:
mysql_function_query(ConexionDB, Query, true, "OnQueryFinish", "ii", 0, playerid);
There's "OnQueryFinish" which is a public function which is called once that query is completed. That's where you should check if the password is correct or wrong.


And why would you possibly only return 1; in PassValida(playerid, cadena[]). If that is your function for validating passwords, it always returns "true"

Learn to do threaded queries or go back to MySQL R6.
In the end it was a mistake in the query.
+REP.