SA-MP Forums Archive
Error 33: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: Error 33:Array Must be indexed (/showthread.php?tid=327384)



Error 33:Array Must be indexed - jtemple042996 - 20.03.2012

I tried to create this if statement:

Код:
if (sscanf(params, "s[128]",status)) return SendClientMessage(playerid, 0xFFFFFFFF,"Correct Usage: /radio on/off");
	if (status == "on")
	{
	}
	else if (status == "off")
	{
	}
	else
	{
	SendClientMessage(playerid,0x828282FF,"Correct Usage: /radio on/off!");
	}
and i recieve :

Код:
\filterscripts\policev3.pwn(176) : error 033: array must be indexed (variable "status")
filterscripts\policev3.pwn(179) : error 033: array must be indexed (variable "status")



Re: Error 33:Array Must be indexed - Vince - 20.03.2012

You can't compare strings like that, this is not PHP. https://sampwiki.blast.hk/wiki/Strcmp