05.08.2019, 12:47
При убийстве на капте вылазит такая вот ошибка за пределом массива
Не могу понять делаю так не получается так сяк.
Ошибка на строке 63308
Ещё тут
PHP Code:
Attempted to read/write array element at index 24 in array of size 20
PHP Code:
new PlayerText:capture_PTD[MAX_PLAYERS][16];
#define MAX_GANGS 20
enum Ganginfa{
capture,
score,
captureid,
gangnumber}
new GangInfo[MAX_GANGS][Ganginfa];
#define MAX_GZONE 120
PHP Code:
stock CaptureUpd(bandkiller)
{
new SCORE1[128],SCORE2[128];
tforeach(i)
{
if(!gPlayerLogged[i]) continue; //Вот тут почему тут хз 63308
if(GangInfo[PlayerInfo[i][pMember]][capture] > 0)
{
if(GangInfo[bandkiller][gangnumber] == 1)
{
format(SCORE1, sizeof(SCORE1), "%d", GangInfo[bandkiller][score]);
PlayerTextDrawSetString(i,capture_PTD[i][13], SCORE1);
}
else
{
format(SCORE2, sizeof(SCORE2), "%d", GangInfo[bandkiller][score]);
PlayerTextDrawSetString(i,capture_PTD[i][14], SCORE2);
}
}
}
}
PHP Code:
new bandkiller[2];
if(PlayerInfo[killerid][pLeader] !=0)
{
bandkiller[0] = PlayerInfo[killerid][pLeader];
}
else
{
bandkiller[0] = PlayerInfo[killerid][pMember];
}
if(PlayerInfo[playerid][pLeader] !=0)
{
bandkiller[1] = PlayerInfo[playerid][pLeader];
}
else
{
bandkiller[1] = PlayerInfo[playerid][pMember];
}
if(bandkiller[0] != bandkiller[1])
{
if(GangInfo[bandkiller[0]][capture] && GangInfo[bandkiller[1]][capture] == 1)
{
if(GangInfo[bandkiller[0]][captureid] == GangInfo[bandkiller[1]][captureid])
{
GangInfo[bandkiller[0]][score] = GangInfo[bandkiller[0]][score]+1;
CaptureUpd(bandkiller[0]);//Тут
}
}
}
}