Problem with 3D Dimensional array.
#1

Here's the problem, I am trying to loop through a 50 slot 3D Dimensional array, check which slot has no text [empty string] & save a string in it, them loop once again and save a 2nd string, etc.

The first string works fine, however when I try to save a second string into the array, it sends me an error that after looping through the 50 slot, they're all used even tho I only used one.

Here's the code

Код:
new TheArray[MAX_PLAYERS][50][128];


			    for(new i = 0; i < 50; i++)
			    {
					if(strlen(TheArray[giveplayerid][i]) < 1)
					{
					 
						strmid(TheArray[giveplayerid][i], inputtext, 0, 128);
						return 1;
			                }
			                else
			               {
						SCM(playerid, COLOR_GREY, "ERROR: ERROR MESSAGE");
						return 1;
					}
			    }
			    return 1;
It works fine first time, but for the 2nd time, I get the error.
Reply


Messages In This Thread
Problem with 3D Dimensional array. - by Black Axe - 04.04.2016, 22:19
Re: Problem with 3D Dimensional array. - by AndySedeyn - 04.04.2016, 23:01
Re: Problem with 3D Dimensional array. - by Black Axe - 04.04.2016, 23:16
Re: Problem with 3D Dimensional array. - by AndySedeyn - 04.04.2016, 23:24

Forum Jump:


Users browsing this thread: 2 Guest(s)