22.04.2010, 06:52
Ok, it`s the first time I use a dialog box to make a login/register system. The code is this:
When i try to compile it, I get this error "error 033: array must be indexed (variable "dini_Get")"
Could you help please ?
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 0)
{
if(response == 1)
{
new pname[MAX_PLAYER_NAME], file[128], string[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Users\\%s.ini", pname);
dini_Create(file);
dini_Set(file, "password", inputtext);
dini_IntSet(file, "level", 0);
format(string, sizeof(string), ".:Welcome to the server %s:.", pname);
SendClientMessage(playerid, COLOUR_GREEN, string);
logged[playerid] = 1;
return 1;
}
else
{
SendClientMessage(playerid, COLOUR_RED, "You must login to play on this server!");
Kick( playerid );
return 1;
}
return 1;
}
else if(dialogid == 1)
{
new pname[MAX_PLAYER_NAME], file[128], string[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Users\\%s.ini", pname);
if(dini_Get(file, "password") == inputtext) //Here is the error
{
logged[playerid] = 1;
level[playerid] = dini_Int(file, "level");
SetPlayerMoney(playerid, dini_Int(file, "money"));
SendClientMessage(playerid, COLOUR_GREEN, "You have succesfully logged in!");
return 1;
}
else SendClientMessage(playerid, COLOUR_RED, "Wrong password for this account. Try again!");
return 1;
}
return 1;
}
Could you help please ?

