boa noite. ativei o plugin crashdetect para olhar os erros do gamemode e ir arrumando conforme da com a ajuda do portal samp.
erro:
public do erro:
Índice de matriz fora dos limites traduzido pode ser algo com >=? aonde esta esse erro.. dei uma olhada e não vi algo de errado...
ah e antes disso deu esse erro tb..
erro:
Código PHP:
[22:34:52] [debug] #2 0001f820 in public TimerUpdateServerRanking () in ZP.amx
[22:34:53] [debug] Run time error 4: "Array index out of bounds"
public do erro:
Código PHP:
call:TimerUpdateServerRanking()
{
UpdateServerRanking();
}
static UpdateServerRanking(type = -1)
{
if(!~type)
{
UpdateServerRanking(RANKING_TYPE_KILLS);
UpdateServerRanking(RANKING_TYPE_DEATHS);
UpdateServerRanking(RANKING_TYPE_SCORE);
UpdateServerRanking(RANKING_TYPE_TIME_PLAYED);
UpdateServerRanking(RANKING_TYPE_WANTED_LEVEL);
return;
}
new players = GetPlayerPoolSize(),
higherID[MAX_RANKING_POSITIONS],
morePoints[MAX_RANKING_POSITIONS],
bool:inRanking[MAX_PLAYERS],
playerPoints,
pos,
i;
while(pos < MAX_RANKING_POSITIONS)
{
higherID[pos] = INVALID_PLAYER_ID;
morePoints[pos] = -1;
for(i = 0; i <= players; i++)
{
if(IsPlayerConnected(i) && !playerConnectedNow[i] && !inRanking[i])
{
switch(type)
{
case RANKING_TYPE_KILLS: playerPoints = playerRankingControl[i][E_PLAYER_KILLS];
case RANKING_TYPE_DEATHS: playerPoints = playerRankingControl[i][E_PLAYER_DEATHS];
case RANKING_TYPE_SCORE: playerPoints = GetPlayerScore(i);
case RANKING_TYPE_TIME_PLAYED: playerPoints = GetPlayerTimePlayed(i, true);
case RANKING_TYPE_WANTED_LEVEL: playerPoints = GetPlayerWantedLevel(i);
}
if(playerPoints > morePoints[pos])
{
morePoints[pos] = playerPoints;
higherID[pos] = i;
}
}
if(i == players && higherID[pos] != INVALID_PLAYER_ID)
{
inRanking[higherID[pos]] = true;
}
}
pos++;
}
new
resultHigherID[MAX_RANKING_POSITIONS],
resultMorePoints[MAX_RANKING_POSITIONS],
resultListType[MAX_RANKING_POSITIONS],//0 - lista de jogadores on, 1 - lista de jogadores off
resultInRanking[MAX_RANKING_POSITIONS * 2][MAX_PLAYER_NAME],
inRankingIndex,
bool:found,
a;
pos = 0;
while(pos < MAX_RANKING_POSITIONS)
{
resultHigherID[pos] = INVALID_PLAYER_ID;
resultMorePoints[pos] = -1;
resultListType[pos] = 0;
for(i = 0; i < MAX_RANKING_POSITIONS; i++)
{
for(a = 0; a < inRankingIndex; a++)
{
if(higherID[i] != INVALID_PLAYER_ID && !isnull(resultInRanking[a]) && !strcmp(resultInRanking[a], GetNameOfPlayer(higherID[i])))
{
found = true;
break;
}
}
if(found)
{
found = false;
continue;
}
if(morePoints[i] > resultMorePoints[pos])
{
resultHigherID[pos] = i;
resultMorePoints[pos] = morePoints[i];
resultListType[pos] = 0;
}
}
for(i = 0; i < MAX_RANKING_POSITIONS; i++)
{
for(a = 0; a < inRankingIndex; a++)
{
if(serverRanking[i][type][E_PLAYER_VALUE] != -1 && !isnull(resultInRanking[a]) && !strcmp(resultInRanking[a], serverRanking[i][type][E_PLAYER_NAME]))
{
found = true;
break;
}
}
if(found)
{
found = false;
continue;
}
if(serverRanking[i][type][E_PLAYER_VALUE] > resultMorePoints[pos])
{
resultHigherID[pos] = i;
resultMorePoints[pos] = serverRanking[i][type][E_PLAYER_VALUE];
resultListType[pos] = 1;
}
}
if(resultHigherID[pos] != INVALID_PLAYER_ID)
{
if(resultListType[pos])
{
format(resultInRanking[inRankingIndex], MAX_PLAYER_NAME, serverRanking[resultHigherID[pos]][type][E_PLAYER_NAME]);
format(serverRanking[pos][type][E_PLAYER_NAME], MAX_PLAYER_NAME, serverRanking[resultHigherID[pos]][type][E_PLAYER_NAME]);
serverRanking[pos][type][E_PLAYER_VALUE] = serverRanking[resultHigherID[pos]][type][E_PLAYER_VALUE];
}
else
{
format(resultInRanking[inRankingIndex], MAX_PLAYER_NAME, GetNameOfPlayer(higherID[resultHigherID[pos]]));
format(serverRanking[pos][type][E_PLAYER_NAME], MAX_PLAYER_NAME, GetNameOfPlayer(higherID[resultHigherID[pos]]));
serverRanking[pos][type][E_PLAYER_VALUE] = morePoints[resultHigherID[pos]];
}
inRankingIndex++;
}
pos++;
}
}
Índice de matriz fora dos limites traduzido pode ser algo com >=? aonde esta esse erro.. dei uma olhada e não vi algo de errado...
ah e antes disso deu esse erro tb..
Código PHP:
[22:34:30] [debug] Long callback execution detected (hang or performance issue)