[Help] - 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: [Help] - Login problem (
/showthread.php?tid=489072)
[Help] - Login problem -
SpaMaster - 20.01.2014
Hello guys, it's me

.
This time I got a problem with password on login. Whatever I type, server just accept it. Here's an login code, if you can find a problem ? Thanks
Код:
case DIALOG_LOGIN:
{
if(!response) return Kick(playerid);
if(response)
{
new hashpass[50];
WP_Hash(hashpass,sizeof(hashpass),inputtext);
if(!strcmp(hashpass, PlayerData[playerid][pPass], false))
{
INI_ParseFile(UserPath(playerid),"LoadUser_%s",.bExtra = true, .extra = playerid);
SetPlayerScore(playerid,PlayerData[playerid][pLevel]);
GivePlayerMoney(playerid,PlayerData[playerid][pNovac]);
}
else
{
Kick(playerid);
}
}
}
Re: [Help] - Login problem -
Sithis - 20.01.2014
!strcmp means 0, however strings can also compare into negative values. You'll need to check it against it being 0.
EDIT:
(source: SA-MP wiki)
-1 if string1 comes before string2
1 if string1 comes after string2
0 if the strings are the same (for the matched length).
Important Note: This function also returns 0 if either string is empty.
Re: [Help] - Login problem -
SpaMaster - 20.01.2014
Quote:
Originally Posted by Sithis
!strcmp means 0, however strings can also compare into negative values. You'll need to check it against it being 0.
EDIT:
(source: SA-MP wiki)
-1 if string1 comes before string2
1 if string1 comes after string2
0 if the strings are the same (for the matched length).
Important Note: This function also returns 0 if either string is empty.
|
Can you explain that better ? Please, I didn't understand you.
Re: [Help] - Login problem -
Sithis - 20.01.2014
Quote:
Originally Posted by SpaMaster
Can you explain that better ? Please, I didn't understand you.
|
Read what i pasted from the wiki. Strcmp
ONLY returns 0 if the strings are
COMPLETELY identical, or if one of the strings you input is empty.
You probably have one of the strings empty, make sure you input two values into strcmp.
Re: [Help] - Login problem -
SpaMaster - 20.01.2014
Quote:
Originally Posted by Sithis
Read what i pasted from the wiki. Strcmp ONLY returns 0 if the strings are COMPLETELY identical, or if one of the strings you input is empty.
You probably have one of the strings empty, make sure you input two values into strcmp.
|
My English is retarded, still, I can't understand you haha. Nevermind, I'll find out how.