[REP++] Server crashed / Error log here
#1

Server suddenly crashed , what could be the problem ? Look down.


pawn Код:
[15:51:29] [debug] Server crashed while executing gm.amx
[15:51:29] [debug] AMX backtrace:
[15:51:29] [debug] #0 0030336c in GetPlayersOnServer () at D:\x.pwn:54874
[15:51:29] [debug] #1 00057398 in public PTimer (playerid=42) at D:\x.pwn:3257
[15:51:29] [debug] Native backtrace:
[15:51:29] [debug] #0 f74ade8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[15:51:29] [debug] #1 f74a6bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[15:51:29] [debug] #2 f74a7dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[15:51:29] [debug] #3 f74a8226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[15:51:29] [debug] #4 f74adadc in ?? () from plugins/crashdetect.so
[15:51:29] [debug] #5 f779b410 in ?? ()

pawn Код:
GetPlayersOnServer()
{
    new count = 0;
    foreach(new x : Player)
    {
        if(IsPlayerConnected(x))
        {
            count++;
        }
    }
    return count;
}


pawn Код:
This is how i use it....

        if(GetPlayersOnServer() >= 195)
        {
                   // script code
        }
        else
        {
                      //script code
       
        }

I rep the person who helps me!
Reply
#2

And if you do like this?...
Код:
new players = GetPlayerOnServer();
if(players >= 195)
{
}
//And more...
Reply
#3

I think foreach (x : Player) only loops thru connected players so the isplayerconnected is useless but thats not what causes the crash ^^
Reply
#4

Oh, sorry
Please tell us what are the lines of the mistakes... For me it will be easier.
Sorry for my bad english:v
Reply
#5

Why did you create this function when you could simply use foreach's Iter_Count?

PHP код:
new players Iter_Count(Player);
if(
players >= 195) {
    
//

Reply
#6

I don't think your code crashes the server (but you should definitely optimize it, that use of loops is so wrong), probably it's because of the timer (PTimer). Maybe SA:MP has an internal Timers limit that we are not aware of.
Reply
#7

Ok, this is solved, but how about this?

Код:
[21:09:30] [debug] Server crashed while executing gm.amx
[21:09:30] [debug] AMX backtrace:
[21:09:30] [debug] #0 native format () from samp03svr
[21:09:30] [debug] #1 000ba57c in public MP_OPC () at D:\Work\Server\gamemodes\bigupdated20.pwn:9810
[21:09:30] [debug] #2 native CallLocalFunction () from samp03svr
[21:09:30] [debug] #3 00048de4 in public OnPlPa_OnPlayerConnect (playerid=39) at D:\Work\Server\pawno\include\mSelection.inc:432
[21:09:30] [debug] #4 native CallLocalFunction () from samp03svr
[21:09:30] [debug] #5 00044780 in public _y_utils_OnPlayerConnect (playerid=39) at D:\Work\Server\pawno\include\OnPlayerPause.inc:106
[21:09:30] [debug] #6 0001bfac in public Hook_OnPlayerConnect (playerid=39) at D:\Work\Server\pawno\include\YSI\..\YSI_Data\..\YSI_Internal\..\YSI_Core\y_utils.inc:234
[21:09:30] [debug] #7 native CallLocalFunction () from samp03svr
[21:09:30] [debug] #8 000078f0 in public SSCANF_OnPlayerConnect (playerid=39) at D:\Work\Server\pawno\include\beaZone.inc:75
[21:09:30] [debug] #9 00000908 in OnPlayerConnect (playerid=39, ... <1073741822 arguments>) at D:\Work\Server\pawno\include\sscanf2.inc:205
[21:09:30] [debug] #10 0001d628 in public OnPlayerConnect (... <1 argument>) at D:\Work\Server\pawno\include\YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[21:09:30] [debug] Native backtrace:
[21:09:30] [debug] #0 f7420e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[21:09:30] [debug] #1 f7419bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[21:09:30] [debug] #2 f741adbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[21:09:30] [debug] #3 f741b226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[21:09:30] [debug] #4 f7420adc in ?? () from plugins/crashdetect.so
[21:09:30] [debug] #5 f770e410 in ?? ()
[21:09:30] [debug] #6 080965d7 in ?? () from samp03svr
[21:09:30] [debug] #7 080dce72 in ?? () from samp03svr
[21:09:30] [debug] #8 080950e4 in ?? () from samp03svr
[21:09:30] [debug] #9 f741c94b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[21:09:30] [debug] #10 f741f8f8 in ?? () from plugins/crashdetect.so
[21:09:30] [debug] #11 f7423916 in amx_Exec () from plugins/crashdetect.so
[21:09:30] [debug] #12 f741bbe6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[21:09:30] [debug] #13 f741f659 in ?? () from plugins/crashdetect.so
[21:09:30] [debug] #14 f737c2ea in ?? () from plugins/streamer.so
[21:09:30] [debug] #15 080dfd62 in ?? () from samp03svr
[21:09:30] [debug] #16 080950e4 in ?? () from samp03svr
[21:09:30] [debug] #17 f741c94b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[21:09:30] [debug] #18 f741f8f8 in ?? () from plugins/crashdetect.so
[21:09:30] [debug] #19 f7423916 in amx_Exec () from plugins/crashdetect.so
[21:09:30] [debug] #20 f741bbe6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[21:09:30] [debug] #21 f741f659 in ?? () from plugins/crashdetect.so
[21:09:30] [debug] #22 f737c2ea in ?? () from plugins/streamer.so
[21:09:30] [debug] #23 080dfd62 in ?? () from samp03svr
[21:09:30] [debug] #24 080950e4 in ?? () from samp03svr
[21:09:30] [debug] #25 f741c94b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[21:09:30] [debug] #26 f741f8f8 in ?? () from plugins/crashdetect.so
[21:09:30] [debug] #27 f7423916 in amx_Exec () from plugins/crashdetect.so
[21:09:30] [debug] #28 f741bbe6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[21:09:30] [debug] #29 f741f659 in ?? () from plugins/crashdetect.so
[21:09:30] [debug] #30 f737c2ea in ?? () from plugins/streamer.so
[21:09:30] [debug] #31 080dfd62 in ?? () from samp03svr
[21:09:30] [debug] #32 080950e4 in ?? () from samp03svr
[21:09:30] [debug] #33 f741c94b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[21:09:30] [debug] #34 f741f8f8 in ?? () from plugins/crashdetect.so
[21:09:30] [debug] #35 f7423916 in amx_Exec () from plugins/crashdetect.so
[21:09:30] [debug] #36 f741bbe6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[21:09:30] [debug] #37 f741f659 in ?? () from plugins/crashdetect.so
[21:09:30] [debug] #38 f737c2ea in ?? () from plugins/streamer.so
[21:09:30] [debug] #39 080a51c9 in ?? () from samp03svr
[21:09:30] [debug] #40 080d09ff in ?? () from samp03svr
[21:09:30] [debug] #41 080b5515 in ?? () from samp03svr
[21:09:30] [debug] #42 08071d38 in ?? () from samp03svr
[21:09:30] [debug] #43 08071e32 in ?? () from samp03svr
[21:09:30] [debug] #44 0807bc50 in ?? () from samp03svr
[21:09:30] [debug] #45 080aed3d in ?? () from samp03svr
[21:09:30] [debug] #46 080aef02 in ?? () from samp03svr
[21:09:30] [debug] #47 080aa13a in ?? () from samp03svr
[21:09:30] [debug] #48 f745abd6 in __libc_start_main () from /lib32/libc.so.6
[21:09:30] [debug] #49 0804b4e1 in ?? () from samp03svr
Reply
#8

You may scripted something wrong,
Or try to update your includes/plugins,
Repeat your mistakes too.
Reply
#9

Код:
GetPlayersOnServer()
{
	new count; //Whenever you make an int variable,its default value is 0
	foreach(Player, i)
	{
	  	if(IsPlayerConnected(i))
	  	{
			count++;
		}
	}
	return count;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)