SA-MP Forums Archive
Need help stcrmp - 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: Need help stcrmp (/showthread.php?tid=340131)



Need help stcrmp - RicaNiel - 06.05.2012

pawn Код:
if(!strcmp(pData[playerid][pPass],h_password,true))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        SCM(playerid,C_GREEN,"Loggedin");
        logged[playerid] = 1;
    }
Guys i always got correct password even if i use the error password
what is wrong with this one i even load it


Re: Need help stcrmp - [HiC]TheKiller - 06.05.2012

Make sure that both of the variables in the strcmp actually have a value, if they don't it will return a match anyway. Use print and debug them like this:
pawn Код:
print(pData[playerid][pPass]);
print(h_password);
If one of them creates a blank line in the console, then the strcmp isn't the issue.


Re: Need help stcrmp - ToiletDuck - 06.05.2012

Just /changepass and try to type the error password
the same as mine i just /changepass and its fixed


Re: Need help stcrmp - mprofitt - 06.05.2012

Quote:
Originally Posted by RicaNiel
Посмотреть сообщение
pawn Код:
if(!strcmp(pData[playerid][pPass],h_password,true))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        SCM(playerid,C_GREEN,"Loggedin");
        logged[playerid] = 1;
    }
Guys i always got correct password even if i use the error password
what is wrong with this one i even load it
Comparing string lenths will add an extra check.

pawn Код:
if(!strcmp(pData[playerid][pPass],h_password,true) && strlen(Data[playerid][pPass]) == strlen(h_password))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        SCM(playerid,C_GREEN,"Loggedin");
        logged[playerid] = 1;
    }



Re: Need help stcrmp - RicaNiel - 06.05.2012

so what do i need to do?
i have debugegd its same but still correct password when i try to do a incorrect password