SA-MP Forums Archive
/changepass - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /changepass (/showthread.php?tid=219259)



/changepass - Unknown123 - 01.02.2011

pawn Код:
dcmd_changepass(playerid, params[])
{
    new FileL[68];
    new Name[MAX_PLAYER_NAME];

    GetPlayerName(playerid, Name , sizeof(Name));
    format(FileL, sizeof(FileL), SERVER_USER_FILE, Name);
   
    new OldPass, NewPass;
    OldPass = dini_Int(FileL, "Password");
   
    if(sscanf(params, "ss", OldPass, NewPass)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /changepass (password) (new password)");
    else if(OldPass == NewPass) return SendClientMessage(playerid, COLOR_USAGE, "ERROR: You typed same password");
    {
        dini_IntSet(FileL, "Password", udb_hash(NewPass)); //error 035: argument type mismatch (argument 1)

        SendClientMessage(playerid, COLOR_BLUE, "You have changed your password.");
        return 1;
    }
}



Respuesta: /changepass - ipsBruno - 01.02.2011

pawn Код:
dcmd_changepass(playerid, params[])
{
    new FileL[64];
    new Name[MAX_PLAYER_NAME];

    GetPlayerName(playerid, Name , sizeof(Name));
    format(FileL, sizeof(FileL), SERVER_USER_FILE, Name);
   
    new OldPass, NewPass;
   
    if(sscanf(params, "ss", OldPass, NewPass)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /changepass (password) (new password)");
    if(OldPass == NewPass) return SendClientMessage(playerid, COLOR_USAGE, "ERROR: You typed same password");    

    dini_IntSet(FileL, "Password", udb_hash(NewPass)); //error 035: argument type mismatch (argument 1)
    SendClientMessage(playerid, COLOR_BLUE, "You have changed your password.");
    return 1;
}



Re: /changepass - California - 01.02.2011

A password is a combination of letters + integers, so this is the right one.

pawn Код:
dini_Set(FileL, "Password", udb_hash(NewPass));



Re: /changepass - Unknown123 - 01.02.2011

error 035: argument type mismatch (argument 1)

...


Respuesta: /changepass - ipsBruno - 01.02.2011

@California

My pass:

Example:

iamgay -> 18189718711

18189718711 = Number

Is udb_hash '-'


Re: /changepass - Unknown123 - 01.02.2011

But how to fix my problem?


Re: /changepass - California - 01.02.2011

Can I please see the 'SERVER_USER_FILE' define?


Re: /changepass - Unknown123 - 01.02.2011

Quote:
Originally Posted by California
Посмотреть сообщение
Can I please see the 'SERVER_USER_FILE' define?
#define SERVER_USER_FILE "Users/%s.L"