[help] problem with /CHANGEPASSWORD
#1

Hi, I was writting /changepassword command in dialog, and I quited becouse of many errors ( I am begginer )

if Someone can help me

with making /changepassword (in dialog) And /changepassword [new password] ??

I am using YCMD + sscanf

there are variables:

pawn Код:
#define DIALOG_CHANGEPW 3
#define USER_FILE       "Igraci/%s.ini"

enum pInfo
{
     pPassword[129]
}

public LoadUserData(playerid, name[], value[])
{
    INI_String("Lozinka", PlayerInfo[playerid][pPassword], 129);
    // Eng. password = bos. Lozinka :D
    return 1;
}

OnPlayerRegister(playerid, lozinka[])
{
    new uFile[35];
    format(uFile, 35, USER_FILE, PlayerName(playerid));
    new INI:playerFile = INI_Open(uFile);
    INI_WriteString(playerFile, "Lozinka", lozinka);
    INI_Close(playerFile);
    return 1;
}

SacuvajIgraca(playerid) // = Save Player
{
    new uFile[35];
    format(uFile, 35, USER_FILE, PlayerName(playerid));
    new INI:playerFile = INI_Open(uFile);
    INI_WriteString(playerFile, "Lozinka", PlayerInfo[playerid][pPassword]);
    INI_Close(playerFile);
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_REGISTER:
        {
            if(response)
            {
                new
                    jstring[128];

                if(strlen(inputtext) >= 6 && strlen(inputtext) <= 35)
                {
                    OnPlayerRegister(playerid, inputtext);
                    pokazilog(playerid);
                    ClearChat(playerid, COLOR_NEGRONI, 7);
                    SCM(playerid, COLOR_NEGRONI, "{ffffff}============================================");
                    format(jstring, sizeof(jstring), " Succesfully registered! Your pass: %s", inputtext);
                    SCM(playerid, COLOR_YELLOW, jstring);
                }
                else
                {
                    pokazireg(playerid); /// shows the Register Dialog!
                    SCM(playerid, COLOR_DSB, " 6 - 35 characters please!");
                }
            }
            else Kick(playerid);
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)