SA-MP Forums Archive
Whats wrong here? - 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: Whats wrong here? (/showthread.php?tid=589326)



Whats wrong here? - gmstrikker - 18.09.2015

Код:
 SHA256_PassHash(inputtext, HASH_SENHA, PlayerInfo[playerid][pSenha], 64);
Код:
error 017: undefined symbol "SHA256_PassHash"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Код:
	new query[1024], ip[25];
    if(dialogid == DIALOG_REGISTER)
    {
        if(!response) return Kick(playerid);
        if(response)
        {
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Please enter a valid password!", "Please enter a valid registration password\nTo continue press Register\n\nOxiRegister 1.0\n", "Register", "Quit");
            else
            {
                SHA256_PassHash(inputtext, HASH_SENHA, PlayerInfo[playerid][pSenha], 64);

                GetPlayerIp(playerid, ip, sizeof(ip));
                format(query, sizeof(query), "INSERT INTO `accounts` (`Username`, `Senha`, `IP`) VALUES ('%s', '%s', '%s')", GetName(playerid), PlayerInfo[playerid][pSenha], ip);
                mysql_query(ConnectMYSQL,query);
                pInfo[playerid][Registered] = true;
                pInfo[playerid][LoggedIn] = true;
                Logado[playerid] = 1;
                tutorial[playerid] = -1;
                SetPlayerHealthEx(playerid, 100);

                pInfo[playerid][UserID] = cache_get_field_content_int(0, "UserID");
                OnPlayerLogin(playerid);
            }
        }
        return 1;
    }
    if(dialogid == DIALOG_LOGIN)
    {
        if(!response) return Kick(playerid);
        if(response)
        {
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Please enter a valid password!", "Please enter your valid logging in password\nTo continue press log-in", "Log-in", "Quit");
            else
            {
                Senha[64];
                SHA256_PassHash(inputtext,HASH_SENHA,Senha,64);

                mysql_format(ConnectMYSQL, query, sizeof(query), "SELECT * FROM accounts WHERE Senha = '%e' LIMIT 0,1", Senha);
                mysql_pquery(ConnectMYSQL, query, "OnLogin", "d", playerid);
            }
        }
        return 1;
    }



Re: Whats wrong here? - xVIP3Rx - 18.09.2015

The problem is the server doesn't understand what is "SHA256_PassHash", you didn't include/define/native it..


Re: Whats wrong here? - X337 - 18.09.2015

SHA256_PassHash was added in SA-MP 0.3.7 R1!
Make sure you've updated the include file to newest SA-MP server version


Re: Whats wrong here? - gmstrikker - 18.09.2015

Quote:
Originally Posted by X337
Посмотреть сообщение
SHA256_PassHash was added in SA-MP 0.3.7 R1!
Make sure you've updated the include file to newest SA-MP server version
ty rep+