Array must be indexed
#1

The error:
pawn Код:
error 033: array must be indexed (variable "RestrictedSkins")
The error relates to this line:
pawn Код:
if (strval(inputtext) == RestrictedSkins[i])
The array:
pawn Код:
new RestrictedSkins[29][] =
{
    74, 71, 265, 266, 267, 274, 275, 276, 277, 278, 279, 280, 281, 282,
    283, 284, 285, 286, 287, 288, 300, 301, 302, 306, 307, 308, 309,
    310, 311
};
The code:
pawn Код:
for (new i=0; i < sizeof RestrictedSkins; i++)
{
       if (strval(inputtext) == RestrictedSkins[i])
       {
                SendClientMessage(playerid, COLOUR_WHITE, ERROR_PREFIX"You entered a skin ID that is blocked from public use.");
        ShowPlayerDialog(playerid, dialog_skin, DIALOG_SKIN_STYLE, DIALOG_SKIN_CAPTION, DIALOG_SKIN_INFO, DIALOG_SKIN_BUTTON_1, DIALOG_SKIN_BUTTON_2);
        return 1;
    }
}
Reply
#2

No need for a 2D array:
pawn Код:
new RestrictedSkins[] =
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
No need for a 2D array:
pawn Код:
new RestrictedSkins[] =
Ah thank you, sorry just learning arrays again.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)