11.05.2015, 23:21
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:
This is the code I'm using:
The error line is:
My (almost empty and useless) enum:
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")
pawn Код:
new targetPlayer, targetName[64];
targetPlayer = GetClosestBot(playerid, 1.5);
format(targetName, 64, "%s", npcInfo[targetPlayer][Name]);
if(targetName == "dopgs9NPC") {}
pawn Код:
if(targetName == "dopgs9NPC")
pawn Код:
enum botDataEnum
{
Name[64]
}
new npcInfo[MAX_PLAYERS][botDataEnum];