View Full Version : [ HELP ] Again Need Help Regarding infinite Loops!

12/03/2015, 10:38 AM
Hellu Guys!
Is there is anyone who is Expert in removing Infinite loops? I need a Preson who can remove the infinite loops from my script please :( ! I Can't verify where the hell infinite loops are problem'ing me! Soon i will release this GM without Any bugs!

Thx for Help in Advance! I will give him Credits on my GM!

- Best Regards,

12/03/2015, 10:52 AM
Wrong section, go here (http://forum.sa-mp.com/showthread.php?t=447813).

12/03/2015, 10:57 AM
I don't think people gonna reply me there! by the way i just need suggestion about infinite loops! how can i know about the particular place where the infinite loops are! is there is any plugin or script that may tell me about the infinite loops?

12/03/2015, 11:03 AM
If it causes your server to crash, download CrashDetector (http://forum.sa-mp.com/showthread.php?t=262796), it'll print usefull information about the crash in your server console.

12/03/2015, 11:06 AM
No no When i Start my Server, After 10 - 15 minutes all players got kicked for not logon to Game!
i asked a person so he said it is a problem of infinite loops! i just wanna remove them from my script

12/03/2015, 11:14 AM
Then you could try looking at this thread:
There's some usefull stuff, and a way to detect infinite loops it seems.

12/03/2015, 11:23 AM
I Already Tired them! I couldn't get them! how to do! sorry :( its new thing for me! so i can't fix it

12/03/2015, 02:46 PM
Anyone who can do it for me! please :( it will be great for me!

12/03/2015, 02:49 PM
Well, just post what the problem is.. not requesting a scripter.

12/03/2015, 03:03 PM
You should try to find the problem by yourself otherwise you will come again

For example try to add debug lines in your code

// 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);
#define debug1(%0);
#if DEBUG >= 2
#define debug2(%0); printf(%0);
#define debug2(%0);
#if DEBUG >= 3
#define debug3(%0); printf(%0);
#define debug3(%0);
// add more levels if you want
#define debug(%0);

Example usage

// 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);

Than you know where the code stoped / went into an infinite loop