Register/login system not working correctly... -
karakana7 - 31.10.2010
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!
Re: Register/login system not working correctly... -
karakana7 - 31.10.2010
So can someone help, I know that there is people who using it.
Re: Register/login system not working correctly... -
karakana7 - 31.10.2010
Oh, I can't get any help in this forum...I'm so sad.
Re: Register/login system not working correctly... -
karakana7 - 31.10.2010
REFRESH!
Re: Register/login system not working correctly... -
karakana7 - 31.10.2010
REFRESH!
Re: Register/login system not working correctly... -
karakana7 - 31.10.2010
REFRESH!
Re: Register/login system not working correctly... -
Mike_Peterson - 31.10.2010
Theres a rule, dont bump within 12 hours anyway... send me a private message with ur MSN or summing inside coz im too lazy to script it here.
Re: Register/login system not working correctly... -
karakana7 - 01.11.2010
REFRESH!
Re: Register/login system not working correctly... -
(SF)Noobanatior - 01.11.2010
Код:
if(strlen(params))
{
new pass[256];
pass = dini_Get(file, "Password");
if(dini_Exists(file))
{
if(!strlen(params))SendClientMessage(playerid,0xFFFFFFFF,"You must type a password");
if(strcmp(params, pass, false))
{
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;
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "Wrong password");
}
}
}
try that but your not setting the file nam it looks like to me how do you define "file"