SA-MP Forums Archive
Array must be indexed (FROM PUBLIC Function!) - 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 (FROM PUBLIC Function!) (/showthread.php?tid=604150)



Array must be indexed (FROM PUBLIC Function!) - Stefand - 01.04.2016

Hey,

I have this public function:
pawn Код:
forward PropertyPTD(playerid,create,string[]);
public PropertyPTD(playerid, create, string[])
And a check in that public:
pawn Код:
if(string == "House"){
But I get this error:
Код:
error 033: array must be indexed (variable "string")



Re: Array must be indexed (FROM PUBLIC Function!) - Misiur - 01.04.2016

You can't compare strings like that. Use
pawn Код:
if(!strcmp(string, "House"))



Re: Array must be indexed (FROM PUBLIC Function!) - Stefand - 01.04.2016

Cheeers Repped