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)
+--- Thread: Array must be indexed (/showthread.php?tid=612048)



Array must be indexed - GoldenLion - 13.07.2016

Hi, I just made this:

Код:
code removed, i don't want to release it :P
But when I compile it I get this error:
Код:
(25028) : error 033: array must be indexed (variable "inputtext")
I ******d, I tried changing inputtext to strval(inputtext), it compiled good but it doesn't work properly. When I try to search a vehicle plate then it just says "License Plate:" (blank). And even if the plate is valid it says "Vehicle was not found in the database." What do I need to do with the inputtext for it to work?


Re: Array must be indexed - Konstantinos - 13.07.2016

Your code:
pawn Код:
if (CarData[carid][carPlate] == inputtext)
carPlate is a string I assume and so inputtext is, use strcmp to compare them.


Re: Array must be indexed - GoldenLion - 13.07.2016

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Your code:
pawn Код:
if (CarData[carid][carPlate] == inputtext)
carPlate is a string I assume and so inputtext is, use strcmp to compare them.
Thank you.