error 033: array must be indexed ..
#1

I've been trying to fix the Auto-Login script, but i always get the same error:
Код:
error 033: array must be indexed (variable "plrIP")
Code:
pawn Код:
new plrIP[16];
        GetPlayerIp(playerid, plrIP, sizeof(plrIP));
        if(PlayerInfo[playerid][pACBanned] == 0 && PlayerInfo[playerid][pBanned] == 0)
        {
            if(PlayerInfo[playerid][pIP] == plrIP) //This is the error line!
            {
                SendClientMessage(playerid, -1, "{FFFFFF}* {00C0FF}You've been Auto Logged-In by the server!");
                INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
                SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
                PlayerInfo[playerid][pLoggedIn] = 1;
                SendClientMessage(playerid, -1, "{FFFFFF}* {00C0FF}Stats initialized successfully!");
            }
            else
            {
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Type your password below to login.","Login","Quit");
            }
        }
I've been trying to do stuff like plrIP[playerid], plrIP[16], plrIP[playerid][16] etc., but i still get the error.

Any ideas of how to fix it?
Reply
#2

You can't use the '==' operator on strings since they are complex data structures, you'll need to use the strcmp function.
Reply
#3

Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)