This plugin helps you debug runtime errors and server crashes. When something goes wrong you see a more or less detailed error message that contains description of the error, the stack trace of the offending script and additionally the system call stack in case of a server crash. This can greatly reduce th amount of time spent spotting the erroneous code and fixing it.
See the original topic on the SA-MP Forums for more information and examples.
Get latest binaries for Windows and Linux here.
You have to tell the Pawn compiler to include debugging information in the
resulting AMX file. This can be accomplished by passing either -d2
or -d3
flag to it at the command line. The easiest way is:
-
Create a file called
pawn.cfg
inside yourpawno
directory if it does not already exist -
Open it in your favourite text editor and insert
-d3
(preceding with a space it the file was not empty)
This file is basically a list of flags that will be passed to the compiler
whenever you hit F5 in Pawno. If you use someting other than Pawno you might
need to put that file in the same directory as the script you compile lives
in because most editors don't set current working directory to pawno
.
It might be easier to add the exta flags via your editor's options.
If you put the AMX file in some custom directory other than gamemodes
or
filterscripts
or in ia subdirectory of these CrashDetect will not be able to
find it when loading debug info. In order to fix this you have to specify the
path manually via the AMX_PATH
environment variable which is a
semicolon-separated (or colon-separated on Linux) list of paths, similar to
the PATH
variable. The path can be absolute or relative to the server root.
Yes, use the OnRuntimeError(error_code, &bool:suppress)
callback. Set the
suppress
parameter to true
to suppress error message.