array index out of bounds
#1

Код:
[17/10/2015 00:55:45] [debug] Run time error 4: "Array index out of bounds"
[17/10/2015 00:55:45] [debug]  Accessing element at index 6 past array upper bound 5
[17/10/2015 00:55:45] [debug] AMX backtrace:
[17/10/2015 00:55:45] [debug] #0 00043924 in ?? (0x00000000, 0x00000006) from ARP.amx
[17/10/2015 00:55:45] [debug] #1 001c3398 in public cmd_adjust (0x00000000, 0x0151f260) from ARP.amx
[17/10/2015 00:55:45] [debug] #2 native CallLocalFunction () [004743b0] from samp-server.exe
[17/10/2015 00:55:45] [debug] #3 000040e8 in public OnPlayerCommandText (0x00000000, 0x0151f214) from ARP.amx
Код:
} else if(strcmp(choice,"uninvite",true) == 0) {
			if(!strlen(opstring))
				return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /adjust uninvite [playerid/partofname]");
				
			new 
				giveplayerid = ReturnUser(opstring);
								
				if(PlayerInfo[giveplayerid][pRank] > PlayerInfo[playerid][pRank])
					return SendClientMessage(playerid, COLOR_GREY, "You can't uninvite higher ranks.");
					
					
				for (new x = 0; x < MAX_POINTS; x++)
				{
					if(Points[x][ClaimerId] == giveplayerid)
						return SendClientMessage(playerid, COLOR_GRAD1, "You can't uninvite them as they're capturing a point.");
				}
				
				format(string, sizeof(string), "* You've kicked %s out of your family.",GetPlayerNameEx(giveplayerid));
				SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
				format(string, sizeof(string), "* Family leader %s has kicked your out of the family.",GetPlayerNameEx(playerid));
				SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
				familyLog(PlayerInfo[giveplayerid][pID], GetPlayerNameEx(giveplayerid), PlayerInfo[playerid][pID], GetPlayerNameEx(playerid), PlayerInfo[playerid][pGang], 2, GetPlayerRankName(PlayerInfo[giveplayerid][pGang], PlayerInfo[giveplayerid][pRank]));
				PlayerInfo[giveplayerid][pGang] = 255;
				PlayerInfo[giveplayerid][pRank] = 0;
				PlayerInfo[giveplayerid][pCrew] = 0;
				FamilyInfo[family][FamilyMembers] --;
				format(string, sizeof(string), "%s (ID: %d) uninvited %s (ID: %d) from family %d ", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(giveplayerid), PlayerInfo[giveplayerid][pID], family+1);
				Log("logs/family.log", string);
				if(!IsValidSkin(GetPlayerSkin(giveplayerid)))
				{
					new rand = random(sizeof(CIV));
					SetPlayerSkin(giveplayerid, CIV[rand]);
					PlayerInfo[giveplayerid][pSkin] = CIV[rand];
				}
				return true;
			} else SendClientMessage(playerid, COLOR_GREY, "Wrong id!");
		}
Any clue?
Reply
#2

What did you define MAX_POINTS to? I bet you have it as #define MAX_POINTS 5.

If that's so, increase it.
Reply
#3

Which line produce this error?
Reply
#4

Sorry double post
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)