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=525162)



Array must be indexed - cnoopers - 10.07.2014

Код:
new msg1 = strdel(text, newline, 128);
new msg2 = strdel(text, 0, newline);
What is wrong?


Re: Array must be indexed - Battlezone - 10.07.2014

Please show the whole code ( i mean the error part ) and full pawn compiler output


Re: Array must be indexed - NaClchemistryK - 10.07.2014

That is the error part.
And the error is "error [number]: Array must be indexed."
And as said above, we need more of the code, probably the whole code. Please provide it


Re: Array must be indexed - Threshold - 10.07.2014

'strdel' does not return a value, so having something equal to it is illogical.

The function Strmid would be better for this situation.

pawn Код:
new msg1[128], msg2[128];
    strmid(msg1, string, 0, newline);
    strmid(msg2, string, newline, strlen(string) - 1);