array must be indexed?
#1

Hi SAMP Forum.

Before you all say "WIKI", or "This is PAWN basics", can i just point out that i have had no sleep, and started this at 2am GMT Time. I dont know why either, i was bored lol.

Well anway, Im having a few problems with a global array. Here are the errors:

pawn Код:
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\newwork.pwn(59) : error 033: array must be indexed (variable "gPlayerMission")
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\newwork.pwn(61) : error 033: array must be indexed (variable "gPlayerMission")
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\newwork.pwn(68) : error 033: array must be indexed (variable "gPlayerMission")
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\newwork.pwn(71) : error 033: array must be indexed (variable "gPlayerMission")
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\newwork.pwn(81) : error 033: array must be indexed (variable "gPlayerMission")
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\newwork.pwn(85) : error 033: array must be indexed (variable "gPlayerMission")
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\newwork.pwn(87) : error 033: array must be indexed (variable "gPlayerMission")
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\newwork.pwn(98) : error 033: array must be indexed (variable "gPlayerMission")
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\newwork.pwn(101) : error 033: array must be indexed (variable "gPlayerMission")
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\newwork.pwn(103) : error 033: array must be indexed (variable "gPlayerMission")
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\newwork.pwn(112) : error 033: array must be indexed (variable "gPlayerMission")
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\newwork.pwn(113) : error 033: array must be indexed (variable "gPlayerMission")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


12 Errors.
However my "gPlayerMission" is here:
pawn Код:
new gPlayerMission[150];
My code is to pick a line from an array, save that line into gPlayerMission, and then call gPlayerMission in a place where i need something from the array, like this:
pawn Код:
MissionArray[gPlayerMission][lx]
Can somebody help me? And after this i might get some sleep

- Also while im here, can anybody think of anything i could do for SA-MP's forum (filterscript prefferably)

Thanks
Ash

EDIT: Fixed, i forget to add the [playerid] index - silly how little things are the biggest problems
Thanks Anyway guys and girls
Reply
#2

An array as a whole cannot be used in a expression; you must
indicate an element of the array between square brackets.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)