Register/login system not working correctly...
#1

So i was creating this script by this tutorial: https://sampforum.blast.hk/showthread.php?tid=174575 .Don't say that dini is very slow and use other method or something, because I want to learn it.But there is very strange thing with this code-so when I register everything is ok, in Users folder appear my file with nickname, but I wanted to try how working this code:
Код:
	
if(strlen(params))
    {
        new pass[256];
        pass = dini_Get(params, "Password");
	if(dini_Exists(file))
	    {
	         if(strcmp(params, pass, false) != 0)
		    {
	                SendClientMessage(playerid, 0xFFFFFFFF, "Wrong password");
		    }
		 else
		    {
		        dini_IntSet(file,"Logged",1);
			Player[playerid][Logged] = 1;
			Player[playerid][Level] = dini_Int(file,"Level");
			SendClientMessage(playerid,0xFFFFFFFF,"You are logged now, you can click on spawn button!");
			return 1;
                    }
	    }
	}
And to see if my code is working.So I tryed to type my password wrong, not like when I registered, so he had to show me "Wrong password" message, but it showed me not this message, but the next message: "You are logged now, you can click on spawn button!"....But I typed password incorrectly and this function if(strlen(params)) checking did I write it correctly or incorrectly!!!But by my example it doesn't checking, you can write bad pass or good-no difference, it will log you in anyway...So what is wrong, please help me!

And second problem is that, when i connect I can spawn in the game even if I didn't logged or registered.I'll appreciate every help!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)