SA-MP Forums Archive
033: array must be indexed (variable "-unknown") - 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: 033: array must be indexed (variable "-unknown") (/showthread.php?tid=511602)



033: array must be indexed (variable "-unknown") - Eth - 06.05.2014

Hey there, i got this strange error when i tried to compile a new command o.o here is it:
pawn Код:
CMD:claninvite(playerid,params[])
{
new id,string[257],string2[267];
if(sscanf(params,"ui",id)) return SendClientMessage(playerid, COLOR_RED, "Usage:/claninvite [PlayerID]");
if(pInfo[playerid][inclan] == 0) return SendClientMessage(playerid,COLOR_RED,"{FF0000}Error:{FFFFFF}you are not in a clan");
//errorline:
if(pInfo[playerid][clantag] == "None") return SendClientMessage(playerid,COLOR_RED,"{FF0000}Error:{FFFFFF}You didn't set a clan tag for your clan, /clantag to set one");//end of error line
if(pInfo[id][inclan] == 1) return SendClientMessage(playerid,COLOR_RED,"{FF0000}Error:{FFFFFF}The player is already in a clan");
if(playerid == id) return SendClientMessage(playerid,COLOR_RED,"{FF0000}Error:{FFFFFF}YOu can't invite your self in a clan");
format(string,sizeof(string),"[INFO] player %s invited you to join his clan type /clanacc or /clandec ",GetName(playerid));
SendClientMessage(id,COLOR_YELLOW,string);
format(string2,sizeof(string2),"[INFO] you invited %s to join your clan and waiting for respond");
SendClientMessage(playerid,COLOR_YELLOW,string);
claninvited[id] = 1;
clanFrom[id] = playerid;
return 1;
}



Re: 033: array must be indexed (variable "-unknown") - Konstantinos - 06.05.2014

That's not how you can compare strings. Use strcmp function.


Re: 033: array must be indexed (variable "-unknown") - Eth - 06.05.2014

.....fixed + rep to you