17.03.2011, 16:31
error 033: array must be indexed (variable "dini_Get")
pawn Код:
dcmd_login(playerid, params[])
{
new name[MAX_PLAYER_NAME], file[200];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "\\users\\%s.ini", name);
if(Logged[playerid] == 1) return SendClientMessage(playerid, COLOUR_RED, "You are already logged in!");
if(!dini_Exists(file)) return SendClientMessage(playerid, COLOUR_RED, "This name isn't registered! Please register now!");
else if(strlen(params) == 0) return SendClientMessage(playerid, COLOUR_RED, "You must enter a password to login!");
else if(params[0] != dini_Get(file, "password")) return SendClientMessage(playerid, COLOUR_RED, "Login failed!");//THIS LINE
else
{
SetPlayerMoney(playerid, dini_Int(file, "cash"));
SetPlayerScore(playerid, dini_Int(file, "score"));
Logged[playerid] = 1;
SendClientMessage(playerid, COLOUR_YELLOW, "You are now logged in, and your stats were automaticly loaded!");
}
return 1;
}