y_ini problems..
#1

I've got an enum;

pawn Код:
enum    pData
{
    Password[64],
        ..
}
new p_Data[MAX_PLAYERS][pData];
And I use this function to load the data..

pawn Код:
public LoadUser_data(playerid,name[],value[])
{
    INI_String( "Password",     p_Data[playerid][Password], 64);
        ..
        return 1;
}
In order to register through a dialog, I do this to write the password to the file..

pawn Код:
format(pTxt, 64, "%s", inputtext);
INI_WriteString(AccountData,    "Password",     pTxt);
and I check if the password is correct by using..
pawn Код:
if(strcmp(inputtext, p_Data[playerid][Password], true) == 0) {
This part does not seem to work (the password is correct check); What's wrong?

EDIT: Here's my entire login dialog if that helps any:

pawn Код:
case d_Login: {
       
            if(!response) {
                SendClientMessage(playerid, COLOR_ERROR, "Sorry! You are required to register before playing!");
                return Kick(playerid);
            }
       
            if(!strlen(inputtext))
                return ShowPlayerDialog(playerid, d_Login, DIALOG_STYLE_PASSWORD, "{009AC9}Welcome back!", "{FFFFFF}Please type your {2A9107}password {FFFFFF}below to access your account information!", "Connect", "Quit");
       
            printf("%s", inputtext);
            if(strcmp(inputtext, p_Data[playerid][Password], true) == 0) {
           
                TogglePlayerSpectating(playerid, 0);
           
                INI_ParseFile(FetchTheirAccountLocation(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                GivePlayerMoney(playerid, p_Data[playerid][Money]);
           
                SetSpawnInfo(playerid, 0, p_Data[playerid][SkinModel], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
            }
            else return ShowPlayerDialog(playerid, d_Login, DIALOG_STYLE_PASSWORD, "{009AC9}Welcome back!", "{FFFF00}You have entered an incorrect password!\n{FFFFFF}Please type your {2A9107}password {FFFFFF}below to access your account information!", "Connect", "Quit");
        }
Reply


Messages In This Thread
y_ini problems.. - by 2KY - 19.01.2012, 00:03
Respuesta: y_ini problems.. - by OPremium - 19.01.2012, 00:26
Re: Respuesta: y_ini problems.. - by 2KY - 19.01.2012, 00:44

Forum Jump:


Users browsing this thread: 1 Guest(s)