GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "/users/%s.save", udb_encode(name));
new login;
login=dini_Get(string,"login");
if(login==1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "SERVER: You are already logged in.");
return 1;
}
login=dini_Get(string,"login");
error 006: must be assigned to an array
if(strcmp(cmd, "/login", true) == 0)
{
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "/users/%s.save", udb_encode(name));
if(!dini_Exists(file))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "SERVER: Account does not exist, register with /register.");
return 1;
}
else if(dini_Exists(file))
{
tmp=strtok(cmdtext, idx);
if(dini_Int(file,"login")==1)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "SERVER: You are already logged in.");
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "SERVER: You did not write a password.");
return 1;
}
else if(strlen(tmp))
{
if(dini_Get(file,"password")!=tmp)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "SERVER: Incorrect password.");
}
else if(dini_Get(file,"password")==tmp)
{
dini_Int(file,"login",1);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "SERVER: You are now logged in.");
}
if(dini_Get(file,"password")!=tmp)
if(dini_Get(file,"password")==tmp)
error 033: array must be indexed (variable "dini_Get")
error 033: array must be indexed (variable "dini_Get")
if(dini_Get(file,"password")!=tmp)
if(!strcmp(dini_Get(file,"password"),tmp))
|
Originally Posted by paytas
Then it's dini_Int.
But i encourage you to not use dini, it's slow as hell. |
|
Originally Posted by ronyx69
Thanks, yezizhu. It's working.
DracoBlue: The storing is because i will make an auto-login. |