12.03.2015, 15:03
You should try to find the problem by yourself otherwise you will come again
For example try to add debug lines in your code
Example usage
Than you know where the code stoped / went into an infinite loop
For example try to add debug lines in your code
pawn Код:
// somewhere at top
#define DEBUG 1 // 0 is no debug, 2 would activate 2 and 1
#if DEBUG != 0
#define debug(%0, debug%0(
#if DEBUG >= 1
#define debug1(%0); printf(%0);
#else
#define debug1(%0);
#endif
#if DEBUG >= 2
#define debug2(%0); printf(%0);
#else
#define debug2(%0);
#endif
#if DEBUG >= 3
#define debug3(%0); printf(%0);
#else
#define debug3(%0);
#endif
// add more levels if you want
#else
#define debug(%0);
#endif
pawn Код:
// debug level 1, publics like OnPlayerConnect
debug(1, "OnPlayerConnect(%d);" playerid);
// debug level 2 for functions or inside before bigger codes like loops
debug(2, "Player Loop");
// debug level 3 for example in OnPlayerUpdate (gets called very often)
debug(3, "OnPlayerUpdate(%d)", playerid);

