08.12.2014, 20:41
Hello, I have gone thought my job system, while testing out one of my jobs, I was getting debug warnings, I can't see where i've gone wrong.
Thank you if you know what's up, I will be grateful to get rid of this.
Код:
[21:21:45] [debug] Run time error 4: "Array index out of bounds" [21:21:45] [debug] Accessing element at index 11 past array upper bound 7 [21:21:45] [debug] AMX backtrace: [21:21:45] [debug] #0 0000103c in public OnPlayerEnterCheckpoint (0) from Jobs0.1.amx [21:21:58] [debug] Run time error 4: "Array index out of bounds" [21:21:58] [debug] Accessing element at index 11 past array upper bound 7 [21:21:58] [debug] AMX backtrace: [21:21:58] [debug] #0 0000103c in public OnPlayerEnterCheckpoint (0) from Jobs0.1.amx [21:21:58] [debug] Run time error 4: "Array index out of bounds" [21:21:58] [debug] Accessing element at index 10 past array upper bound 7 [21:21:58] [debug] AMX backtrace: [21:21:58] [debug] #0 0000103c in public OnPlayerEnterCheckpoint (0) from Jobs0.1.amx [21:22:41] [debug] Run time error 4: "Array index out of bounds" [21:22:41] [debug] Accessing element at index 9 past array upper bound 7 [21:22:41] [debug] AMX backtrace: [21:22:41] [debug] #0 0000103c in public OnPlayerEnterCheckpoint (0) from Jobs0.1.amx [21:23:09] [debug] Run time error 4: "Array index out of bounds" [21:23:09] [debug] Accessing element at index 9 past array upper bound 7 [21:23:09] [debug] AMX backtrace: [21:23:09] [debug] #0 0000103c in public OnPlayerEnterCheckpoint (0) from Jobs0.1.amx [21:23:26] [debug] Run time error 4: "Array index out of bounds" [21:23:26] [debug] Accessing element at index 9 past array upper bound 7 [21:23:26] [debug] AMX backtrace: [21:23:26] [debug] #0 0000103c in public OnPlayerEnterCheckpoint (0) from Jobs0.1.amx [21:23:57] [debug] Run time error 4: "Array index out of bounds" [21:23:57] [debug] Accessing element at index 13 past array upper bound 7 [21:23:57] [debug] AMX backtrace: [21:23:57] [debug] #0 0000103c in public OnPlayerEnterCheckpoint (0) from Jobs0.1.amx
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 431)//Bus
{
switch (BusDriver[playerid])
{
case 1:
{
GameTextForPlayer(playerid, "~y~Go to the next bus stop!", 5, 500);
}
case 2:
{
GivePlayerMoney(playerid, 500);
}
case 3, 4, 6, 7, 8, 9, 10, 11:
{
GivePlayerMoney(playerid, 500);
}
}
BusDriver[playerid] = BusDriver[playerid] + 1;
if (BusDriver[playerid] == sizeof(BusCP))
BusDriver[playerid] = 1;
SetPlayerCheckpoint(playerid, BusCP[BusDriver[playerid] - 1][0], BusCP[BusDriver[playerid] - 1][1], BusCP[BusDriver[playerid] - 1][2], 5);//busstop2
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)//Pizza
{
if(Pizzaboy[playerid] == 1)
{
new rand = random(sizeof(PizzaCP));
SetPlayerCheckpoint(playerid, PizzaCP[rand][0], PizzaCP[rand][1], PizzaCP[rand][2], 5);
GivePlayerMoney(playerid, PayRandom[rand][0]);
GameTextForPlayer(playerid, "~y~Go deliver them pizzas", 1000, 5);
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 481)//Paper
{
if(PaperBoy[playerid] == 1)
{
new rand = random(sizeof(PaperCP));
SetPlayerCheckpoint(playerid, PaperCP[rand][0], PaperCP[rand][1], PaperCP[rand][2], 5);
GivePlayerMoney(playerid, PaperPay[rand][0]);
GameTextForPlayer(playerid, "~y~Go deliver them Papers", 1000, 5);
{
}
}
}
}
}