27.09.2018, 15:47
Код:
[22:24:21] [debug] Run time error 4: "Array index out of bounds" [22:24:21] [debug] AMX backtrace: [22:24:21] [debug] #0 0053ce3c in public OnPlayerEnterCheckpoint (playerid=0) at ./File/GTA-RP.pwn:94466
Код:
if(DoubleXP) { SendClientMessageEx(playerid, COLOR_YELLOW, "Ban da duoc 2 diem ky nang truck thay vi 1 diem."); PlayerInfo[playerid][pTruckSkill] += 2; if(TruckerTogetther[playerid] != INVALID_PLAYER_ID) { SendClientMessageEx(TruckerTogetther[playerid], COLOR_YELLOW, "Ban da duoc 2 diem ky nang truck thay vi 1 diem."); PlayerInfo[TruckerTogetther[playerid]][pTruckSkill] += 2; } PlayerInfo[playerid][pXP] += PlayerInfo[playerid][pLevel] * XP_RATE * 2; } else if(PlayerInfo[playerid][pDoubleEXP] > 0 && !DoubleXP) { format(string, sizeof(string), "Ban da duoc 2 ky nang truck thay vi 1 diem. Ban co %d gio con lai de nhan doi EXP token.", PlayerInfo[playerid][pDoubleEXP]); SendClientMessageEx(playerid, COLOR_YELLOW, string); PlayerInfo[playerid][pTruckSkill] += 2; if(TruckerTogetther[playerid] != INVALID_PLAYER_ID) { if(PlayerInfo[TruckerTogetther[playerid]][pDoubleEXP] > 0) { format(string, sizeof(string), "Ban da duoc 2 ky nang truck thay vi 1 diem. Ban co %d gio con lai de nhan doi EXP token.", PlayerInfo[TruckerTogetther[playerid]][pDoubleEXP]); SendClientMessageEx(TruckerTogetther[playerid], COLOR_YELLOW, string); PlayerInfo[TruckerTogetther[playerid]][pTruckSkill] += 2; } } PlayerInfo[playerid][pXP] += PlayerInfo[playerid][pLevel] * XP_RATE * 2; } else { PlayerInfo[playerid][pTruckSkill] += 1; if(TruckerTogetther[playerid] != INVALID_PLAYER_ID) { PlayerInfo[TruckerTogetther[playerid]][pTruckSkill] += 1; } PlayerInfo[playerid][pXP] += PlayerInfo[playerid][pLevel] * XP_RATE; } if(PlayerInfo[playerid][pDaily_Status] == 1 && PlayerInfo[playerid][pDaily_Step] == 2 && PlayerInfo[playerid][pDaily_Step_Status] == 0) { PlayerInfo[playerid][pDaily_Count]++; if(PlayerInfo[playerid][pDaily_Count] == DAILY_TRUCK_DELIVER_TURN) { PlayerInfo[playerid][pDaily_Step_Status] = 1; SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban da hoan thanh nhiem vu so 2: 'Giao 5 chuyen Truck' hay tro lai gap NPC de nhan nhiem vu tiep theo."); } } if(TruckerTogetther[playerid] != INVALID_PLAYER_ID) { if(PlayerInfo[TruckerTogetther[playerid]][pDaily_Status] == 1 && PlayerInfo[TruckerTogetther[playerid]][pDaily_Step] == 2 && PlayerInfo[TruckerTogetther[playerid]][pDaily_Step_Status] == 0) { PlayerInfo[TruckerTogetther[playerid]][pDaily_Count]++; if(PlayerInfo[TruckerTogetther[playerid]][pDaily_Count] == DAILY_TRUCK_DELIVER_TURN) { PlayerInfo[TruckerTogetther[playerid]][pDaily_Step_Status] = 1; SendClientMessageEx(TruckerTogetther[playerid], COLOR_LIGHTBLUE, "Ban da hoan thanh nhiem vu so 2: 'Giao 5 chuyen Truck' hay tro lai gap NPC de nhan nhiem vu tiep theo."); } } } if(PlayerInfo[playerid][pDaily_Status] == 1 && PlayerInfo[playerid][pDaily_Step] == 10 && PlayerInfo[playerid][pDaily_Step_Status] == 0) { PlayerInfo[playerid][pDaily_Count]++; if(PlayerInfo[playerid][pDaily_Count] == DAILY_TRUCK_DELIVER_TURN) { PlayerInfo[playerid][pDaily_Step_Status] = 1; SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban da hoan thanh nhiem vu so 10: 'Giao 5 chuyen Truck' hay tro lai gap NPC de nhan nhiem vu tiep theo."); } } if(TruckerTogetther[playerid] != INVALID_PLAYER_ID) { if(PlayerInfo[TruckerTogetther[playerid]][pDaily_Status] == 1 && PlayerInfo[TruckerTogetther[playerid]][pDaily_Step] == 10 && PlayerInfo[TruckerTogetther[playerid]][pDaily_Step_Status] == 0) { PlayerInfo[TruckerTogetther[playerid]][pDaily_Count]++; if(PlayerInfo[TruckerTogetther[playerid]][pDaily_Count] == DAILY_TRUCK_DELIVER_TURN) { PlayerInfo[TruckerTogetther[playerid]][pDaily_Step_Status] = 1; SendClientMessageEx(TruckerTogetther[playerid], COLOR_LIGHTBLUE, "Ban da hoan thanh nhiem vu so 10: 'Giao 5 chuyen Truck' hay tro lai gap NPC de nhan nhiem vu tiep theo."); } } } TruckUsed[playerid] = INVALID_VEHICLE_ID; TruckUsed[TruckerTogetther[playerid]] = INVALID_VEHICLE_ID; TruckerTogetther[playerid] = INVALID_PLAYER_ID; TruckerTogetther[TruckerTogetther[playerid]] = INVALID_PLAYER_ID; DeletePVar(playerid, "TruckDeliver");
Код:
TruckUsed[playerid] = INVALID_VEHICLE_ID; TruckUsed[TruckerTogetther[playerid]] = INVALID_VEHICLE_ID; TruckerTogetther[playerid] = INVALID_PLAYER_ID; TruckerTogetther[TruckerTogetther[playerid]] = INVALID_PLAYER_ID; DeletePVar(playerid, "TruckDeliver");