PDA

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


SpikY_
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,
[EGC]SpikY_

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

SpikY_
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?

CalvinC
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.

SpikY_
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

CalvinC
12/03/2015, 11:14 AM
Then you could try looking at this thread:
http://forum.sa-mp.com/showthread.php?t=413146
There's some usefull stuff, and a way to detect infinite loops it seems.

SpikY_
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

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

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

Nero_3D
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);
#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

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