error 033: array must be indexed
#1

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;
}
Reply
#2

Dini_Get returns a full string which you are trying to compare with 1 sign. Use strcmp to check the full string instead.
Reply
#3

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
Dini_Get returns a full string which you are trying to compare with 1 sign. Use strcmp to check the full string instead.
ty vm man ! +1 rep
Reply
#4

It's no problem :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)