Arrays
#1

So I have an annoying issue with arrays here.

I'm using FCNPC and I need to acquire the NPC name and match it with a string.

ERROR:
pawn Код:
error 033: array must be indexed (variable "targetName")
This is the code I'm using:
pawn Код:
new targetPlayer, targetName[64];
targetPlayer = GetClosestBot(playerid, 1.5);
format(targetName, 64, "%s", npcInfo[targetPlayer][Name]);
if(targetName == "dopgs9NPC") {}
The error line is:
pawn Код:
if(targetName == "dopgs9NPC")
My (almost empty and useless) enum:
pawn Код:
enum botDataEnum
{
    Name[64]
}
new npcInfo[MAX_PLAYERS][botDataEnum];
Reply


Messages In This Thread
Arrays - by arjanforgames - 11.05.2015, 23:21
Re: Arrays - by Crayder - 11.05.2015, 23:24
Re: Arrays - by arjanforgames - 11.05.2015, 23:37
Re: Arrays - by Crayder - 11.05.2015, 23:42

Forum Jump:


Users browsing this thread: 2 Guest(s)