Login problem - 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: Login problem (
/showthread.php?tid=545744)
Login problem -
Rabea - 10.11.2014
Hello,
i have a problem with registering/logging system.
the problem is when i register i can't login with the password that i created, but every password works ( i can login with every password exept the password that i created )
Example: i register password "123123", and i try to login with "123123" its won't work, but if i tried to login with "asdrqwewq" it works.
i hope i explained good, here is a code that can help:
pawn Код:
else if(dialogid == 2) // Login
{
if(response)
{
new file[64], password[256], IP[16], password2[256];
format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
WP_Hash(password2, sizeof(password2), inputtext);
format(password, sizeof(password), "%s", dini_Get(file, "Password"));
if(strcmp(password2, password, false) == 0)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}Invalid password.");
ShowDialog(playerid, 2);
return 1;
}
Re: Login problem -
Eth - 10.11.2014
you can do something like:
pawn Код:
else if(dialogid == 2) // Login
{
if(response)
{
new file[64], password[256], IP[16], password2[256];
format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
WP_Hash(password2, sizeof(password2), inputtext);
format(password, sizeof(password), "%s", dini_Get(file, "Password"));
if(!strcmp(password2, password, true))//IF THE PLAYER DID RIGHT PASSWORD
{
//CODE IF PASS IS RIGHT
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}Invalid password.");
ShowDialog(playerid, 2);
return 1;
}
Re: Login problem -
Rabea - 10.11.2014
It's giving me 26 errors...
Re: Login problem -
Eth - 10.11.2014
waoh? did you forgot a closing bracket?
Re: Login problem -
Rabea - 10.11.2014
i didn't add anything, just copied
Re: Login problem -
osman2571 - 10.11.2014
try to make that system load user password from ini file..
set file location i think thats is fix
Re: Login problem -
Laurey - 10.11.2014
You have missed a closing brace "{" or "}", try to find where you did the mistake and do a fix.