SA-MP Forums Archive
Password issue Y_ini register system - 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)
+--- Thread: Password issue Y_ini register system (/showthread.php?tid=586091)



Password issue Y_ini register system - YoussefHammad - 19.08.2015

https://sampforum.blast.hk/showthread.php?tid=586090
here's the register system , when i login to my account i write anything and it logs me in , how can i fix this ?


Re: Password issue Y_ini register system - Mariciuc223 - 19.08.2015

Код HTML:
public loadaccount_user
Код HTML:
INI_SetTag(File,"Player's Data");
The loadaccount_%s it's different to the tag you have ...

Код HTML:
INI_SetTag(File,"Player's Data");
to

Код HTML:
INI_SetTag(File,"user");
i'm not so sure that will work , but give a try .


Re: Password issue Y_ini register system - YoussefHammad - 19.08.2015

Quote:
Originally Posted by Mariciuc223
Посмотреть сообщение
Код HTML:
public loadaccount_user
Код HTML:
INI_SetTag(File,"Player's Data");
The loadaccount_%s it's different to the tag you have ...

Код HTML:
INI_SetTag(File,"Player's Data");
to

Код HTML:
INI_SetTag(File,"user");
i'm not so sure that will work , but give a try .
i didnt really get u but i think the issue is pretty much here

Код:
if(dialogid == dlogin)
    {
        if(!response) return Kick(playerid);
        if(response)
        {
            new hashpass[129];
            WP_Hash(hashpass,sizeof(hashpass),inputtext);
            if(!strcmp(hashpass, PlayerInfo[playerid][pPass], false))
            {
                INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
                SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
                GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
                SendClientMessage(playerid,COLOR_YELLOW,"INFO: You have successfully logged in.");
            }
            else
            {
                ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Login","This account is registered. \nWrite your password please.","Login","Quit");
                return 1;
            }
        }
    }
thats in OnDialogResponse , i dont know why this line is not working


Re: Password issue Y_ini register system - Mariciuc223 - 19.08.2015

Change where you find in your script that

Код:
INI_SetTag(File,"Player's Data");
with that

Код:
INI_SetTag(File,"user");
and tell me if that work


Re: Password issue Y_ini register system - YoussefHammad - 19.08.2015

Quote:
Originally Posted by Mariciuc223
Посмотреть сообщение
Change where you find in your script that

Код:
INI_SetTag(File,"Player's Data");
with that

Код:
INI_SetTag(File,"user");
and tell me if that work
nope , still doesnt work


Re: Password issue Y_ini register system - Threshold - 19.08.2015

Check if 'hashpass' or 'PlayerInfo[playerid][pPass]' are empty strings.

Strcmp returns 0 if either of the two strings being compared are empty/null.


Re: Password issue Y_ini register system - YoussefHammad - 19.08.2015

Quote:
Originally Posted by Threshold
Посмотреть сообщение
Check if 'hashpass' or 'PlayerInfo[playerid][pPass]' are empty strings.

Strcmp returns 0 if either of the two strings being compared are empty/null.
i think they're empty tho , i tried deleting (new hashpass[129] from both and adding it on the top of the gm


Re: Password issue Y_ini register system - Vince - 19.08.2015

I've never actively used Y_Ini, but I seem to remember something about not using spaces or special characters in tags. Stick to lower case ASCII only. You might want to check the tags in the file, too.


Re: Password issue Y_ini register system - YoussefHammad - 19.08.2015

nvm i solved the problem. Thanks guys