25.07.2014, 01:13
There is another way to combat this using crashdetect.
Put this at the very top of your GM and use CTRL+H to replace any for by for___loop.
This prints the call stack everytime a loop gets called. So as soon as you run into this problem simply open your server log and look for the last backtrace.
The line number now directs you to the infinite loop in your script (Don't forget to compile with -d3 parameter)
Put this at the very top of your GM and use CTRL+H to replace any for by for___loop.
pawn Код:
#include <crashdetect>
#define for___loop(%1;%2;%3) \
PrintAmxBacktrace(); \
for(%1;%2;%3)
#define while___loop(%1) \
PrintAmxBacktrace(); \
while(%1)
Код:
[03:34:13] [debug] AMX backtrace: [03:34:13] [debug] #0 native PrintAmxBacktrace () [6cf42e23] from crashdetect.DLL [03:34:13] [debug] #1 00001fa8 in main () at C:\server\gamemodes\test.pwn:30