14.09.2017, 18:46
Проблемы в server log после которого крашится сервер и выключается. Помогите пожалуйста решить проблему. ПОСЛЕ КОМПИЛИРОВАНИЯ МОДА - ОШИБОК НЕ ВЫДАЁТ.
Вот эти строки из мода.
Код:
[20:16:12] [debug] Run time error 4: "Array index out of bounds" [20:16:12] [debug] Accessing element at index 33944 past array upper bound 1999 [20:16:12] [debug] AMX backtrace: [20:16:12] [debug] #0 00484e64 in public OnVehicleSpawn (vehicleid=33944) at C:\Users\User.WIN-73R30HPUTRH\Desktop\MODE\gamemodes\ind.pwn:21695 [20:16:12] [debug] Server crashed due to an unknown error [20:39:39] [debug] Run time error 4: "Array index out of bounds" [20:39:39] [debug] Accessing element at negative index -1 [20:39:39] [debug] AMX backtrace: [20:39:39] [debug] #0 0011ffb0 in public UpdateVehiclePos (playerid=-1, vehicleid=0, type=0) at C:\Users\User.WIN-73R30HPUTRH\Desktop\MODE\gamemodes\ind.pwn:15638 [20:39:39] [debug] #1 00485200 in public OnVehicleSpawn (vehicleid=0) at C:\Users\User.WIN-73R30HPUTRH\Desktop\MODE\gamemodes\ind.pwn:21709 [20:39:39] [debug] Server crashed due to an unknown error
Код:
public OnVehicleSpawn(vehicleid) { for(new i; i < 2; i ++) { if(vHomeCar3DText[i][vehicleid] != Text3D:INVALID_3DTEXT_ID) - 21695 строка { DestroyDynamic3DTextLabel(vHomeCar3DText[i][vehicleid]); vHomeCar3DText[i][vehicleid] = Text3D:INVALID_3DTEXT_ID; } } if(RentCar[vehicleid] != -1) { RentCar[vehicleid] = -1; DeletePVar(RentCar[vehicleid], "VehicleRent"); VehInfo[vehicleid-1][vLock] = false; SetVehicleParamsForPlayer(vehicleid,RentCar[vehicleid],0,false); SendClientMessage(RentCar[vehicleid],COLOR_GREY,"Ваш арендованный мотоцикл был заспавнен. {FF0000}Аренда окончена."); } UpdateVehiclePos(-1, vehicleid, 0); - 21709 строка tforeach(i)
Код:
forward UpdateVehiclePos(playerid, vehicleid, type); public UpdateVehiclePos(playerid, vehicleid, type) { if(vehicleid-1 == -1 && playerid != -1) return KillTimer(TimeUpdate[playerid]), 1; if(type == 1) BanCar[vehicleid] = false; GetVehiclePos(vehicleid, VehInfo[vehicleid - 1][vehicleX], VehInfo[vehicleid - 1][vehicleY], VehInfo[vehicleid - 1][vehicleZ]); - 15638 строка GetVehicleZAngle(vehicleid, VehInfo[vehicleid - 1][vehicleA]); return 1; }