Error 032 array index out of bounds

Для компиляции на AMXX 1.9.0 нужно удалить:

Заменить следующее потому что INVISIBLE уже есть в enum DATA_VIP , можно было бы конечно только его но для лучшего кода проще сразу всё:

И после нужно везде изменить где используется g_iPredator, во втором массиве HEAL на PREDATOR_HEAL; INVISIBLE на PREDATOR_INVISIBLE; WEAPON на PREDATOR_WEAPON и THEFT на PREDATOR_THEFT.

Чтобы убрать предупреждения изменяем:

I am trying to monitor a process that the user has chosen. What I am doing is trying to get the filename from the process name so when the process is not found it can launch it again. Now I don’t understand my problem. I am getting the error here: Dim s As String = ProcessArray(0).MainModule.FileName .

The thing I do not understand is that it is returning the filename fine. Can anyone help me pinpoint the issue?

4 Answers 4

The error happens, as the others already said, when there was no process of the given name found. So the only way why s has a valid value when the error occurs is, if you execute your code inside a loop and s have a value from a previous iteration (in which the process still run) when the actual error happens.

Most important is that your code and your description what you want to achieve don’t match. Basically if you want to start the process again when your program cannot found it anymore, then I would expect some kind of loop.

I guess you want something like this:

Important is, that this will block the calling thread forever. So you need to work with multi threading, having one thread calling the method for one procName (if you want to give feedback in an UI or watch multiple processes).

Читайте также:  Http cr minfin74 ru root2 exe

As you said in a comment, you can get a Win32Exception stating that you cannot access a 64 bit process with a 32 bit process. To solve that, start your own program in the same mode as the watched process (force a target CPU under Project settings => Compile => Advanced Compile Options => Target CPU). For more info about that see corresponding other questions like this one.

Вот строки с ошибкой:
==================================================================================================================
new pdddialog[2148];
format(pdddialog, sizeof(pdddialog), "%s%s%s%s%s%s%s%s%s%s%s", newPlayer[0], newPlayer[1], newPlayer[2], newPlayer[3],newPlayer[4], newPlayer[5], newPlayer[6], newPlayer[7],
newPlayer[8], newPlayer[9], newPlayer[10]);
return SPD(playerid, D_NULL, 0, "", pdddialog, "Закрыть", " Лучший ответ

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *