18.06.2009, 00:30
Hey scripters!
I've had some problems with the strcmp syntax.
I'm using it to my login and the problem is that whatever I type it will still login, even when I type the correct password.
The code I'm testing now is
text is the strtok from the command)
And then I simply got the login code under that(But that shouldn't matter to the strcmp syntax)
So when I type the password "Password" I should get spawned and I do , but I can type anything and I will still spawn , I NEVER get the message "Wrong Password".
Can someone please help me out with this?
I'm all out of ideas.
Cheers / Jax!
I've had some problems with the strcmp syntax.
I'm using it to my login and the problem is that whatever I type it will still login, even when I type the correct password.
The code I'm testing now is
text is the strtok from the command)Код:
if(strcmp(text, "Password", false, strlen(text)) != 0)
{
SCM(playerid, COLOR_RED, "MAIN ERROR(Wrong Password!)");
fclose(UserFile);
return 1;
}
So when I type the password "Password" I should get spawned and I do , but I can type anything and I will still spawn , I NEVER get the message "Wrong Password".
Can someone please help me out with this?
I'm all out of ideas.
Cheers / Jax!


trcmp will return 0 if compare with null string.