- 1
Array index out of bounds
-
Similar Content
-
Out Of Stocks
By XeNoN.,
- 1 reply
- 413 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
By XeNoN.,
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
TheGodfather
Salut, uneori apare eroarea aceasta in logurile serverului si nu reusesc sa imi dau seama de ce da eroare la linia asta:
foreach(PersonalVSpawned, idd) if(CarInfo[idd][cTime] < gettime() && CarInfo[idd][cTime] != -1) DestroyPlayerCar(idd);
Eroarea data este:
[16:44:06] [debug] Run time error 4: "Array index out of bounds"
[16:44:06] [debug] Accessing element at index 10001 past array upper bound 9999
[16:44:06] [debug] AMX backtrace:
[16:44:06] [debug] #0 003ed390 in public DecreaseTimer () at C:\Users\x\Desktop\y\gamemodes\z.pwn:36900
Tin sa mentionez ca limita unde da eroarea a fost marita de la 2k la 10k si tot asa face.
functia la care este problema este urmatoarea:
task DecreaseTimer[5000]() {
new string[256];
foreach(PersonalVSpawned, idd) if(CarInfo[idd][cTime] < gettime() && CarInfo[idd][cTime] != -1) DestroyPlayerCar(idd);
foreach(Player, i) {
if(!IsPlayerConnected(i) && IsPlayerLogged[i] != 1)
continue;
new Float: playerArmour;
GetPlayerArmour(i, playerArmour);
if(playerArmour == 100 && PlayerInfo[i][pAdmin] == 0 && GetPVarInt(i, "Armour") == 0) {
if(ServerSystem[3] == 0) NightBot(i, "Cheats (armour-hack)");
}
//if(FPS2[i] == 0 && AFKSeconds[i] > 120 && PlayerInfo[i][pSleeping] == 0) NightBot(i, "rakdroid");
new Float: playerHealth;
GetPlayerArmour(i, playerHealth);
if(playerHealth == 100 && PlayerInfo[i][pAdmin] == 0) {
if(ServerSystem[8] == 0) NightBot(i, "Cheats (health-hack)");
}
if(PlayerInfo[i][pWantedLevel] >= 1 && WantedTime[i] == 10) {
WantedTime[i] = 0;
PlayerInfo[i][pWantedLevel] --;
SetPlayerWantedLevel(i, PlayerInfo[i][pWantedLevel]);
Update(i, pWantedLevelx);
if(PlayerInfo[i][pWantedLevel] == 0) {
SCM(i, COLOR_YELLOW, "Acum nu mai ai wanted deoarece politia ti-a pierdut urma!");
PlayerTextDrawHide(i, WantedTD[i]);
ClearCrime(i);
finishAchievement(i, 15);
}
else {
format(string, sizeof(string), "Politia iti pierde urma! Wanted Actual: %d", PlayerInfo[i][pWantedLevel]);
SCM(i, COLOR_YELLOW, string);
}
format(string, sizeof(string), "%s [%d] lost 1 wanted level. W: %d", GetName(i), i, PlayerInfo[i][pWantedLevel]);
SendTeamMessage(14, 0x2e64feFF, string);
SendTeamMessage(3, COLOR_DBLUE, string);
SendTeamMessage(2, COLOR_DBLUE, string);
SendTeamMessage(1, COLOR_DBLUE, string);
}
if(IsPlayerInRangeOfPoint(i, 30.0, 184.3529,-1825.4983,8.7530)) {
if(GetPVarInt(i, "Listening") == 0) {
PlayAudioStreamForPlayer(i, beachlink, 184.3529,-1825.4983,8.7530, 30.0, 1);
SetPVarInt(i, "Listening", 1);
}
}
else {
if(GetPVarInt(i, "Listening") == 1) SetPVarInt(i, "Listening", 0);
}
// -- Variables
for(new t = 0; t < 18; t++) {
if(DeelayCommand[i][t] != 0) {
DeelayCommand[i][t] -= 5;
if(DeelayCommand[i][t] < 0) DeelayCommand[i][t] = 0;
}
}
for(new t = 0; t < 13; t++) {
if(JobDeelay[i][t] != 0) {
JobDeelay[i][t] -= 5;
if(JobDeelay[i][t] < 0) JobDeelay[i][t] = 0;
}
}
if(PlayerTime[i][0] != 0) PlayerTime[i][0] -= 5;
if(PlayerTime[i][0] < 0) PlayerTime[i][0] = 0;
if(PlayerInfo[i][pReportTime] >= 1) {
PlayerInfo[i][pReportTime] -= 5;
if(PlayerInfo[i][pReportTime] < 0) PlayerInfo[i][pReportTime] = 0;
}
if(PlayerInfo[i][pNewbieMute] >= 1) {
PlayerInfo[i][pNewbieMute] -= 5;
if(PlayerInfo[i][pNewbieMute] < 0) PlayerInfo[i][pNewbieMute] = 0;
}
if(FreezeTime[i] != 0) {
FreezeTime[i] -= 5;
if(FreezeTime[i] < 0) FreezeTime[i] = 0;
if(FreezeTime[i] == 0) {
SCM(i, COLOR_LIGHTBLUE, "Acum nu mai ai freeze!");
TogglePlayerControllable(i, 1);
}
}
if(PlayerToPoint(50, i, -2317.8091,-1637.5575,483.7031)) {
CheckMission(i, m);
for(new m; m < 2; m++) {
if(PlayerInfo[i][pDailyMission][m] == 7) CheckMission(i, m);
}
}
if(PlayerToPoint(50, i, 1962.4126,-2193.3279,13.5469)) {
for(new m; m < 2; m++) {
if(PlayerInfo[i][pDailyMission][m] ==
}
}
if(PlayerToPoint(100, i, 1338.6273,2153.1045,11.0578)) {
for(new m; m < 2; m++) {
if(PlayerInfo[i][pDailyMission][m] == 9) CheckMission(i, m);
}
}
}
return true;
}
25 answers to this question
Recommended Posts