Question

Всем привет. У меня запускается и работает мод, но в один момент крашнуло. Я зашел в логи, а там следующая ошибка:

Спойлер

[17:34:13] [debug] Run time error 4: "Array index out of bounds"
[17:34:13] [debug]  Accessing element at negative index -400
[17:34:13] [debug] AMX backtrace:
[17:34:13] [debug] #0 00803164 in PlayerTimer () at D:\CRMP\Моды\SRP - 2020\gamemodes\new.pwn:33518
[17:34:13] [debug] #1 006184b8 in public @GrandTimer () at D:\CRMP\Моды\SRP - 2020\gamemodes\new.pwn:4383

 

Строчка 33518 -   if(GetVehicleSpeed(i) > VehStats[model-400][vMaxSpeed]+60 && model != 537 && model != 538 && !IsABoat(vehicleid) && !IsAPlane(vehicleid))

Строчка 4384 -  if(FrakCDm > 0 && startwar == false) FrakCDm--;

Решил еще скрин с кодом и номером строки добавить. Может так яснее будет:

 

Спойлер

K-2SVYdgSDQ.jpg?size=1227x537&quality=96&sign=70525ca2c75dfc81aeb0e32f386fc8cc&type=album

 

Спойлер

mIPFjC9eYoM.jpg?size=510x107&quality=96&sign=53c62c50df68cd4fb33ead2656561c41&type=album

 

Share this post


Link to post
Share on other sites

1 answer to this question

  • 0

Переводим фразу "Array index out of bounds" -> "Индекс массива за пределами" и понимаем всё оставшееся.

 

Теперь смотрим внимательнее. Он ругается, сообщая нам о "Accessing element at negative index -400", откуда мы понимаем, что у него индекс отрицательный, а именно -400, чего не может быть.

 

Смотрим код и видим: 

VehStats[model-400]

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Kutuzov
      By Kutuzov
      Всем привет, хотелось бы спросить у тех, кто разбирается в PluginSDK.
      Какие есть источники, руководства, документации о PluginSDK?
      Я пока что ничего нормального не нахожу.
      Заранее спасибо