Problem with /changepassword
#1

Ok i was building an /changepass command but i keep getting this error.

C:\Users\Andre'\Desktop\Andre'\samp\gamemodes\ODA. pwn(1401) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

the coding:

PHP код:
CMD:changepassword(playerid,params[])
{
    if( 
pInfo[playerid][Spawned]    != 1)
    {
        
ShowMessage(playeriderror9);
        return 
1;
    }
    new 
pass[25],file[256];
    if(
sscanf(params"s[25]"pass)) return SendClientMessage(playeriderror"Usage: /Changepassword <New Password>");
    if(
strlen(pass) < || strlen(pass) > 20) return SendClientMessage(playerid,error,"Error: Password lenght must be between 5 - 20 chracters!");
    
format(file256PATHGetName(playerid));
    new 
INI:ACCOUNT INI_Open(file);
    
INI_SetTag(ACCOUNT,"data");
    
INI_WriteString(ACCOUNT"Password",udb_hash(pass));
    
INI_Close(ACCOUNT);
    
format(astringsizeof(astring),"Your password has been successfully changed.{FFFFFF} [NEW PASSWORD: %s]",pass);
    return 
SendClientMessage(playerid,red,astring);
}
stock udb_hash(buf[]) 
{
    new 
length=strlen(buf);
    new 
s1 1;
    new 
s2 0;
    new 
n;
    for (
n=0n<lengthn++)
    {
       
s1 = (s1 buf[n]) % 65521;
       
s2 = (s2 s1)     % 65521;
    }
    return (
s2 << 16) + s1;

PHP код:
INI_WriteString(ACCOUNT"Password",udb_hash(pass)); //error line 
Reply
#2

I think the udb_hash converts the password in an integer, so you must use
Код:
INI_WriteInt
instead

Also, remember to change your INI_String for INI_Int when loading the player's data.
Reply
#3

Quote:
Originally Posted by Troydere
Посмотреть сообщение
I think the udb_hash converts the password in an integer, so you must use
Код:
INI_WriteInt
instead

Also, remember to change your INI_String for INI_Int when loading the player's data.
Thank you again. rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)