Help with dialogs -
nilanjay - 10.08.2011
I am making a dialog system for my server but i got 2 errors.See
Код:
C:\Users\PART\Desktop\Desktop\samp03csvr_R2-2_win32\gamemodes\brp.pwn(358) : error 017: undefined symbol "udb_hash"
C:\Users\PART\Desktop\Desktop\samp03csvr_R2-2_win32\gamemodes\brp.pwn(375) : error 017: undefined symbol "udb_hash"
please help with this.lines are
line 358
pawn Код:
[CODE]dini_IntSet(file, "Password",udb_hash(inputtext));[/CODE]
line 375
Код:
if(udb_hash(inputtext) != tmp)
Re: Help with dialogs -
Riddick94 - 10.08.2011
pawn Код:
stock udb_hash(buf)
{
new length=strlen(buf), s1 = 1, s2 = 0, n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
But i'd rather you to use Whirlpool or other hashing metod.
Re: Help with dialogs -
nilanjay - 10.08.2011
i can't ubderstand what are you saying
Re: Help with dialogs -
OwlCity - 10.08.2011
To solve the problem copy the code of Riddick at the end of your script.
Re: Help with dialogs -
nilanjay - 10.08.2011
I got new errors by adding this see
C:\Users\PART\Desktop\Desktop\samp03csvr_R2-2_win32\gamemodes\brp.pwn(357) : error 035: argument type mismatch (argument 1)
C:\Users\PART\Desktop\Desktop\samp03csvr_R2-2_win32\gamemodes\brp.pwn(365) : warning 217: loose indentation
C:\Users\PART\Desktop\Desktop\samp03csvr_R2-2_win32\gamemodes\brp.pwn(374) : error 035: argument type mismatch (argument 1)
C:\Users\PART\Desktop\Desktop\samp03csvr_R2-2_win32\gamemodes\brp.pwn(367) : warning 204: symbol is assigned a value that is never used: "string"
C:\Users\PART\Desktop\Desktop\samp03csvr_R2-2_win32\gamemodes\brp.pwn(367 -- 38

: warning 217: loose indentation
C:\Users\PART\Desktop\Desktop\samp03csvr_R2-2_win32\gamemodes\brp.pwn(392) : error 035: argument type mismatch (argument 1)
C:\Users\PART\Desktop\Desktop\samp03csvr_R2-2_win32\gamemodes\brp.pwn(395) : error 028: invalid subscript (not an array or too many subscripts): "buf"
C:\Users\PART\Desktop\Desktop\samp03csvr_R2-2_win32\gamemodes\brp.pwn(395) : error 029: invalid expression, assumed zero
C:\Users\PART\Desktop\Desktop\samp03csvr_R2-2_win32\gamemodes\brp.pwn(395) : error 029: invalid expression, assumed zero
C:\Users\PART\Desktop\Desktop\samp03csvr_R2-2_win32\gamemodes\brp.pwn(395) : fatal error 107: too many error messages on one line
lines are
357
pawn Код:
dini_IntSet(file, "Password", udb_hash(inputtext));
374
pawn Код:
if(udb_hash(inputtext) != tmp)
392 - 395
[pawn] new length=strlen(buf), s1 = 1, s2 = 0, n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;[/pawm]
Re: Help with dialogs -
OwlCity - 10.08.2011
Check if you have this line in your code: (At the beginning)
Edit: if not download this file
dudb.inc and copy that in the pawno/include folder.
Delete the code posted above:
pawn Код:
stock udb_hash(buf)
{
new length=strlen(buf), s1 = 1, s2 = 0, n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
and add the line at the top of your script:
Re: Help with dialogs -
Riddick94 - 10.08.2011
Change this:
to this: