[debug] Run time error 4: "Array index out of bounds"
[debug] AMX backtrace:
[debug] #0 000ce928 in ?? (playerid=0, dialogid=60, response=1, listitem=-1, inputtext[]=@026e7c90 "LSPD", ... <1073741818 arguments>) at modules/factions/Functions.pwn:43
[debug] #1 0001c1e4 in public OnDialogResponse (... <5 arguments>) at D:\foldername\pawno\include\YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:114
That's not a YSI error. The problem is here:
modules/factions/Functions.pwn:43 If the error is in that code (which I can't tell because I don't know which is line 43) I'd guess it has something to do with "id" being invalid. |
strmid(OI[id][oPreFix], prefix, 0, strlen(prefix), 10);
new orgid = Iter_Free(CountOrg);
[20:09:53] Faction ID: 0
new id = GetNearestOrganization(playerid);
//
GetNearestOrganization(playerid)
{
for(new b = 1; b < MAX_FACT; b++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, OI[b][oPozExtX], OI[b][oPozExtY], OI[b][oPozExtZ])) return b;
}
return -1;
}
OI[orgid][oPozExtX] = X_C, OI[orgid][oPozExtY] = Y_C, OI[orgid][oPozExtZ] = Z_C;
I mean are you sure that `Iter_Free` should return 1? 0 is always the first value.
|
strmid(OI[id][oPreFix], prefix, 0, strlen(prefix), 5); // line 45
// Enum for Factions
oPreFix[5]
strmid(OI[id][oPreFix], prefix, 0, strlen(prefix), 5);