SA-MP Forums Archive
[HELP]Server Crash - Located crash line with CrashDETECT - - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: [HELP]Server Crash - Located crash line with CrashDETECT - (/showthread.php?tid=535182)



[HELP]Server Crash - Located crash line with CrashDETECT - - Guest4390857394857 - 02.09.2014

pawn Code:
forward scoretimer();
public scoretimer()
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        seconds[i] ++;
        if(seconds[i] == 3600)
        {
            SetPlayerScore(i, GetPlayerScore(i) + 1);
            seconds[i] = 0;
        }
    }
    return 1;
}
Why the above code crashes the server? Can anyone fix the code & also explain me why it crashes?


Re: [HELP]Server Crash - Located crash line with CrashDETECT - - Marsss - 03.09.2014

Let's Fix the Line


forward scoretimer();
public scoretimer()


I think this line is problme becouse you doesn't made the score timer, with (1000,1)

Okay Thanks..

Please REP ME


Re: [HELP]Server Crash - Located crash line with CrashDETECT - - ALBJ - 03.09.2014

lol, nice mars.


AW: [HELP]Server Crash - Located crash line with CrashDETECT - - Harry :) - 04.09.2014

I doubt any of those replies helped you, since it's a script-based problem you could expect more professional help and attention in the Scripting Help Section.


Re: [HELP]Server Crash - Located crash line with CrashDETECT - - Flake. - 05.09.2014

Quote:
Originally Posted by Marsss
View Post
Let's Fix the Line


forward scoretimer();
public scoretimer()


I think this line is problme becouse you doesn't made the score timer, with (1000,1)

Okay Thanks..

Please REP ME



Why are you doing this?
pawn Code:
if(!IsPlayerConnected(i)) continue;
If this player isn't connected then continue the loop?