Issues with three dimensional array
#1

Hey,

I am having some very strange issues with a 3D array that I have. The ranks are loaded from a database, to start out and test with I have the following ranks:



I am however getting a really weird issue, only the latest rank seems to work fine while the rest of the ranks are prefixing themselves 1 by 1 going up with the first character from the rank below (and some unrecognizeable characters).

Here's the console log:

https://pastebin.com/BKb5c5BQ

And here are all the functions I use:

https://pastebin.com/zsRWi9sT

Also, here's what I use to print the loaded ranks afterwards (from a testing command):

Код:
case _H<print_rank>:
		{
			LOG_DEBUG_F("Starting group ranks print, initialized by %s(%s)", PlayerName(playerid), PlayerIP(playerid));
			for (new i = 0; i < sizeof(groupSpawns); i++)
			{
				for (new x = 1; x < MAX_GROUP_RANKS; x++)
				{
					if (strlen(groupRanks[i][x][1]) > 1)
					{
						LOG_DEBUG_F("Group %s(%d) - rank %s(%d)", groupSpawns[i][grSpawn_name], i, groupRanks[i][x][1], x);
					}
				}
			}
		}

How I create the array:

new groupSpawns[MAX_GROUPS][E_CUSTOM_GROUP_SPAWN],
	groupRanks[MAX_GROUPS][MAX_GROUP_RANKS][2];
MAX_GROUP_RANKS is equal to 12.

I have never experienced an issue quite like this and I have no idea why this is happening, does anyone have an idea?

Thank you, I appreciate any help.
Reply
#2

If you have skype PM me it.
Reply
#3

Quote:
Originally Posted by Vin Diesel
Посмотреть сообщение
If you have skype PM me it.
PM has been sent, thanks.
Reply
#4

I think I fixed it guys, if anyone is curious as to how:

Код:
enum E_CUSTOM_GROUP_RANK
{
	gRank_number,
	gRank_name[32]
}
All I did was basically create an enumerator so that the compiler would know the maximum string size, and it did seem to solve it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)