SA-MP Forums Archive
Arry Problem :( - 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: Arry Problem :( (/showthread.php?tid=521826)



Arry Problem :( - danish007 - 24.06.2014

How to fix this probleM?

F:\Danish\CNR\gamemodes\Cops&Robbers.pwn(32579) : error 033: array must be indexed (variable "string")
?

Error Line:
Код:
format(string, sizeof(string), "The Bank");
			if (HouseData[Houseid][h_OwnerName] == string)// error with this :(
			{
			ShowTextDrawMenu(playerid, TD_MENU_HOUSE,"~g~House", 12, 8);
			format(string, sizeof(string), "~p~%s~n~~w~Owner: ~b~%s~n~~w~For Sale ~g~$%d",HouseInfo[Houseid][h_HouseIntName],HouseData[Houseid][h_OwnerName],HouseData[Houseid][h_Value]);
			ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
			ShowTextDrawMenuItems(playerid, 1,  " ", " ", " ",0);
			ShowTextDrawMenuItems(playerid, 2,  " ", " ", " ",0);
			ShowTextDrawMenuItems(playerid, 3,  " ", " ", " ",0);
			ShowTextDrawMenuItems(playerid, 4,  " ", " ", " ",0);
			ShowTextDrawMenuItems(playerid, 5, " ", "~y~1 ~w~- Enter This House", " " ,0);
			ShowTextDrawMenuItems(playerid, 6, " ", "~y~2 ~w~- Knock At The Door", " " ,0);
			ShowTextDrawMenuItems(playerid, 7, " ", "~y~3 ~w~- Attempt To Break In", " " ,0);
			ShowTextDrawMenuItems(playerid, 8, " ", "~y~4 ~w~- Visit This House", " " ,0);
			ShowTextDrawMenuItems(playerid, 9, " ", "~y~5 ~w~- Purchase This House", " " ,0);
			ShowTextDrawMenuItems(playerid, 10, " ", "~y~6 ~w~- Rent This House", " " ,0);
			}



Re: Arry Problem :( - Konstantinos - 24.06.2014

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


Re: Arry Problem :( - danish007 - 24.06.2014

please give me code
for if(HouseData[house][h_OwnerName] == i want this == to The Bank Name)


Re: Arry Problem :( - kamiliuxliuxliux - 24.06.2014

pawn Код:
if(strcmp(HouseData[house][h_OwnerName], "The Bank", true) == 0)