Ime autora: JernejL
Opis: Ovaj plugin nam pomaze odnosno omogucuje da pronadjemo gresku u gamemodeu zbog cega nam ne moze pokrenuti srw, zasto se gasi i tako nesto slicno
Funkcije:
Znaci pokrecete mod!
#include
main() {
function1();
}
function1() {
function2();
}
function2() {
new buf;
fread(File:123, buf);
}
U defaultu kada dođe do funkcije "function2",vaš server će se odmah ugasiti,a ukoliko koristite windows server samo će napisati neki text u crashinfo.txt.
Ali sa CrashDetectom,vi će te vidjeti sljedeÄe:
[05:26:38] Server crashed while executing crash.amx
[05:26:38] Backtrace (most recent call first):
[05:26:38] #0 native fread () from samp-server.exe
[05:26:38] #1 00000090 in ?? () from crash.amx
[05:26:38] #2 00000038 in ?? () from crash.amx
[05:26:38] #3 0000001c in main () from crash.amx
which is more informative. You can also get more information like line numbers, function names, parameter values, etc if compile that script in debug mode to make compiler put extra information about all that stuff into the output .amx (see here for how):
[05:27:11] Server crashed while executing crash.amx
[05:27:11] Backtrace (most recent call first):
[05:27:11] #0 native fread () from samp-server.exe
[05:27:11] #1 000000b8 in function2 () at crash.pwn:13
[05:27:11] #2 00000048 in function1 () at crash.pwn:8
[05:27:11] #3 00000024 in main () at crash.pwn:4
Runtime errorRun time erori su najÄešće napisani u ovom obliku "Run time error
public OnGameModeInit() {
new bla;
new fffuuuu = 0;
fffuuuu = 100;
bla = 100;
return bla;
}Ukoliko kompilate ovaj kod u debug modu i pokrenete server:
[05:32:16] Run time error 4: "Array index out of bounds"
[05:32:16] Accessing element at index 100 past array upper bound 4
[05:32:16] Backtrace (most recent call first):
[05:32:16] #0 00000084 in public OnGameModeInit () at bounds.pwn:11Ukoliko želite napraviti da se vaš server ugasi na prvom "runtime" eroru, namjestite "die_on_error" u vašem server.cfg na 1.
npr: die_on_error 1
Download:
Source code: https://github.com/Zeex/samp-plugin-crashdetect
Pre-built binaries for Linux and Windows: https://github.com/Zeex/samp-plugin-crashdetect/tree/downloads

