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



Array must be indexed - justjamie - 24.05.2016

Hello.
I have a error in my script
PHP код:
      if (PLAYERLIST_authed[playerid])
    {
    for(new 
i=0i<sizeof(cInfo); i++)
    {
      if(
cInfo[i][carteam]==255)
 {
      if(
cInfo[i][id_x]==0)continue;
      new 
name[32],string[128];
      
GetPlayerName(playerid,name,32);
      
format(string,sizeof(string),"%s",name);
      if(
cInfo[i][carowner] != string)continue;
 }
 else
 {
 return 
1;
 } 
what did i do wrong?
It says this line is wrong:
PHP код:
 if(cInfo[i][carowner] != string)continue; 



Re: Array must be indexed - Jefff - 24.05.2016

https://sampwiki.blast.hk/wiki/Strcmp


Re: Array must be indexed - justjamie - 24.05.2016

oh wow i was really dumb here -.-

fixed xx