Доступ к архиву

Переход в группу "Пользователь"

300.00 ₽
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info

Array index out of bounds

Статус
В этой теме нельзя размещать новые ответы.

Stevenson

Умник
Помогите решить ошибку:
PHP:
[21:14:55] [debug] Run time error 4: "Array index out of bounds"
[21:14:55] [debug]  Attempted to read/write array element at index 255 in array of size 100
[21:14:55] [debug] AMX backtrace:
[21:14:55] [debug] #0 0016da18 in public OtherTimer () at E:\rl4ik\gamemodes\new.pwn:23146
[21:14:55] [debug] #1 00328c14 in public CountEx () at E:\rl4ik\gamemodes\new.pwn:44845
[21:14:57] [debug] Run time error 4: "Array index out of bounds"
PHP:
forward CountEx();
public CountEx(){
	OtherTimer();
	for(new x = 0; x < MAX_PLAYERS; x++)
	{
		if(IsPlayerConnected(x)){
			if(PlayerEx[x][ChekEx] == PlayerEx[x][TickEx]){
				if(PlayerEx[x][pSpawnEx] == true){ PlayerEx[x][AFKEx] = true; }}
			PlayerEx[x][ChekEx] = PlayerEx[x][TickEx]; }}
	return true;}
public OtherTimer()
{
	new string[128];
	GetMoney();
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			new name[30];
			GetPlayerName(i, name, sizeof(name));
			format(string,sizeof(string),"%s",name);
			{
				if(PlayerInfo[i][pLogin] == 1)
				{
					if(SafeTime[i] > 0)	SafeTime[i]--;
				}
				if(CellTime[i] > 0 && i != INVALID_PLAYER_ID)
				{
					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]] == 255 && CellTime[i] == 5)
					{
						if(IsPlayerConnected(Mobile[i]))
						{
							new called[MAX_PLAYER_NAME];
							GetPlayerName(Mobile[i], called, sizeof(called));
							format(string, sizeof(string), "У %s звонит мобильник", 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~Phone~n~~r~%d",CallCost[i]);
					PlayerInfo[i][pCash] -=-CallCost[i];
					GameTextForPlayer(i, string, 5000, 1);
					CallCost[i] = 0;
				}
			}
		}
	}
	return true;
}
ошибку пишет в строке:
PHP:
public CountEx: for(new x = 0; x < MAX_PLAYERS; x++) и
public OtherTimer: if (Mobile[Mobile[i]] == 255 && CellTime[i] == 5)
 
Последнее редактирование модератором:
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу