/changepass
#1

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;
    }
}
Reply
#2

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;
}
Reply
#3

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

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

error 035: argument type mismatch (argument 1)

...
Reply
#5

@California

My pass:

Example:

iamgay -> 18189718711

18189718711 = Number

Is udb_hash '-'
Reply
#6

But how to fix my problem?
Reply
#7

Can I please see the 'SERVER_USER_FILE' define?
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)