07.01.2015, 18:23
Код:
[12:23:34] [debug] #0 00055148 in public OtherTimer () from nr-rp.amx [12:23:35] [debug] Run time error 4: "Array index out of bounds" [12:23:35] [debug] Accessing element at index 51 past array upper bound 49
Код:
public OtherTimer()
{
new string[256];
foreach (Player, i)
{
if(CellTime[i] > 0)
{
if (CellTime[i] == cchargetime)
{
CellTime[i] = 1;
if(Mobile[Mobile[i]] == i)
{
CallCost[i] = CallCost[i]+callcost;
}
}
CellTime[i] = CellTime[i] +1;
if (Mobile[Mobile[i]] == MAX_PLAYERS+1 && CellTime[i] == 5)
{
if(IsPlayerConnected(Mobile[i]))
{
new called[MAX_PLAYER_NAME];
GetPlayerName(Mobile[i], called, sizeof(called));
format(string, sizeof(string), "* %s-ov/in telefon zvoni.", called);
RingTone[Mobile[i]] = 10;
ProxDetector(30.0, Mobile[i], string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
}
if(CellTime[i] == 0 && CallCost[i] > 0)
{
format(string, sizeof(string), "~w~Poziv kosta~n~~r~$%d",CallCost[i]);
JBC_GivePlayerMoney(i, -CallCost[i]);
GameTextForPlayer(i, string, 5000, 1);
PlayerInfo[i][pKredit1] =- CallCost[i];
CallCost[i] = 0;
}
}
return 1;
}

