SA-MP Forums Archive
Array must be indexed? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Array must be indexed? (/showthread.php?tid=187386)



Array must be indexed? - Ash. - 02.11.2010

Hi all - A long time since ive needed help but here it goes...

im having a problem with the following code:
pawn Код:
new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    if(pName == "Ash") //On this line is the error.
    {
        printf("GetPlayerMoney: %i", GetPlayerMoney(playerid));
        printf("AntiCheatMoney[myid]: %i", AntiCheatMoney[playerid]); //I have AntiCheatMoney earlier in the script.
    }
It says pName needs indexing. But im using it as a string variable?

RESOLVED

Can anyone else see the problem?


Re: Array must be indexed? - Ash. - 02.11.2010

Just realised i failed and i can use strcmp xD - Thanks Anyway