Hey, i got a problem again.
Now i can't check if the password that the player is writing is the same that is in the file:
Код:
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.");
}
I get error on these:
Код:
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")