SA-MP Forums Archive
[Ajuda] Erro hash - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Erro hash (/showthread.php?tid=459996)



Erro hash - shittt - 25.08.2013

Alguem pode me ajudar com essa nubada q eu fiz ? agradeзo !

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(!dialogid) {
      new Str[128], nome[20];
      GetPlayerName(playerid, nome, 20);
      format(Str, 128, "INSERT INTO `contas`(`Nome`, `Senha`, `Level`, `Admin`, `Respeito`, `Org`, `Membro`) VALUES ('%s', '%i', '%i', '%i', '%i', '%i', '%i')", nome, Hash(inputtext), 10, 8, 150, 2, 1); //linha 76 do erro
      mysql_function_query(connectt, Str, false, #, #);

      return 1;
}

Hash(dados[]) // linha 82 do erro
{
  new hashs;
  for(new i = (strlen(dados) - 1); i > -1; --1) hashs += (dados[1]*dados[(i+1)]); // linha 85 do erro
  return hashs;
}
Erros:

Код:
F:\Users\weverton\Desktop\Nova pasta\gamemodes\new.pwn(76) : error 017: undefined symbol "Hash"
F:\Users\weverton\Desktop\Nova pasta\gamemodes\new.pwn(82) : warning 217: loose indentation
F:\Users\weverton\Desktop\Nova pasta\gamemodes\new.pwn(82) : error 017: undefined symbol "Hash"
F:\Users\weverton\Desktop\Nova pasta\gamemodes\new.pwn(85) : error 017: undefined symbol "dados"
F:\Users\weverton\Desktop\Nova pasta\gamemodes\new.pwn(85) : error 022: must be lvalue (non-constant)
F:\Users\weverton\Desktop\Nova pasta\gamemodes\new.pwn(85) : error 017: undefined symbol "dados"
F:\Users\weverton\Desktop\Nova pasta\gamemodes\new.pwn(85) : fatal error 107: too many error messages on one line



Re: Erro hash - PT - 25.08.2013

tenta usar esta stock

pawn Код:
/*Credits to Dracoblue*/

stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}



Re: Erro hash - shittt - 25.08.2013

Pode me dizer oq ela faz ?

#edit nao funfo

#edit 17:51:03 Resolvido !!! vlw ai era uma chave


Re: Erro hash - smiiir - 25.08.2013

Deixa queto nгo vi o edit ;d