Array index out of bounds.
#2

One of these:
Код:
format(szMessage, sizeof(szMessage), "(Group) MOTD: "EMBED_WHITE"%s", groupVariables[playerVariables[extraid][pGroup]][gGroupMOTD]);

format(string,256,"%s%s",clanVariables[playerVariables[extraid][pClan]][cClanTag],playerVariables[extraid][pNormalName]);

format(string,256,"%s%s",playerVariables[extraid][pNormalName],clanVariables[playerVariables[extraid][pClan]][cClanTag]);
It checks if group or clan is >= 1 only. Checking the upper bound will prevent the run time error:
pawn Код:
if(playerVariables[extraid][pGroup] >= 1 && playerVariables[extraid][pGroup] < sizeof (groupVariables))
// and
if(playerVariables[extraid][pClan] >= 1 && playerVariables[extraid][pClan] < sizeof (clanVariables))
but it might be logical error. What I mean is there are 68 groups or clans defined and the group or clan sql id is 270. Find the array index and use that, not the sql id.
Reply


Messages In This Thread
Array index out of bounds. - by Kortecs - 04.02.2019, 19:35
Re: Array index out of bounds. - by Calisthenics - 04.02.2019, 20:30

Forum Jump:


Users browsing this thread: 1 Guest(s)