Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Server crashed

$
0
0
Hello,

My server crashed because of a format (that's said crashdetect):

[17:58:07] [debug] Server crashed while executing gamemode.amx
[17:58:07] [debug] AMX backtrace:
[17:58:07] [debug] #0 native format () from samp03svr
[17:58:07] [debug] #1 00220668 in public PlayerTimer@_yT () at ../gamemode/a_main.inc:156
[17:58:07] [debug] Native backtrace:
[17:58:07] [debug] #0 f6c09e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[17:58:07] [debug] #1 f6c02bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[17:58:07] [debug] #2 f6c03dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[17:58:07] [debug] #3 f6c04226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[17:58:07] [debug] #4 f6c09adc in ?? () from plugins/crashdetect.so
[17:58:07] [debug] #5 f772e410 in ?? ()
[17:58:07] [debug] #6 080965d7 in ?? () from samp03svr
[17:58:07] [debug] #7 080dce72 in ?? () from samp03svr
[17:58:07] [debug] #8 080950e4 in ?? () from samp03svr
[17:58:07] [debug] #9 f6c0594b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[17:58:07] [debug] #10 f6c088f8 in ?? () from plugins/crashdetect.so
[17:58:07] [debug] #11 f6c0c916 in amx_Exec () from plugins/crashdetect.so
[17:58:07] [debug] #12 f6c04be6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[17:58:07] [debug] #13 f6c08659 in ?? () from plugins/crashdetect.so
[17:58:07] [debug] #14 f6b76d36 in ?? () from plugins/streamer.so
[17:58:07] [debug] #15 080ebc05 in ?? () from samp03svr
[17:58:07] [debug] #16 080af03c in ?? () from samp03svr
[17:58:07] [debug] #17 080aa13a in ?? () from samp03svr
[17:58:07] [debug] #18 f7478bf6 in __libc_start_main () from /lib32/libc.so.6
[17:58:07] [debug] #19 0804b4e1 in ?? () from samp03svr

PlayerTimer is a one second timer.

Code:

if(playerVariables[playerid][pSpectating] != INVALID_PLAYER_ID)
        {
                new string[300], id = playerVariables[playerid][pSpectating];
                if(GetPlayerInterior(playerid) != GetPlayerInterior(playerVariables[playerid][pSpectating])){
                        SetPlayerInterior(playerid, GetPlayerInterior(playerVariables[playerid][pSpectating]));
                }
                if(GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(playerVariables[playerid][pSpectating])){
                        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerVariables[playerid][pSpectating]));
                }
                if(GetPVarInt(playerid, "SpecType") == 1 && IsPlayerInAnyVehicle(playerVariables[playerid][pSpectating]))
                {
                        PlayerSpectateVehicle(playerid, GetPlayerVehicleID(playerVariables[playerid][pSpectating]));
                        SetPVarInt(playerid, "SpecType", 2);
                }
                if(GetPVarInt(playerid, "SpecType") == 2 && !IsPlayerInAnyVehicle(playerVariables[playerid][pSpectating]))
                {
                        PlayerSpectatePlayer(playerid, playerVariables[playerid][pSpectating]);
                        SetPVarInt(playerid, "SpecType", 1);
                }
                if(IsPlayerInAnyVehicle(playerVariables[playerid][pSpectating]))
                {
                        new Float:health;
                        GetVehicleHealth(GetPlayerVehicleID(id), health);
                        format(string, sizeof(string), "%s (~r~%d~w~) - l ~r~%d~w~~n~health: ~r~%.0f~w~~n~w: ~r~%d ~w~- jail: ~r~%d~w~~n~car: ~r~%d ~w~(~r~%.0f ~w~HP)~n~speed: ~g~ %d km/h", N(id), id, playerVariables[id][pLevel], playerVariables[id][pHealth], playerVariables[id][pWanted], playerVariables[id][pJailed], GetPlayerVehicleID(id), health, getVehicleSpeed(GetPlayerVehicleID(id), 0));
                        PlayerTextDrawSetString(playerid, DMVTD[playerid], string);
                }
                else
                {
Crash line -->        format(string, sizeof(string), "%s (~r~%d~w~) - l ~r~%d~w~~n~health: ~r~%.0f~w~~n~w: ~r~%d ~w~- jail: ~r~%d", N(id), id, playerVariables[id][pLevel], playerVariables[id][pHealth], playerVariables[id][pWanted], playerVariables[id][pJailed]);
                        PlayerTextDrawSetString(playerid, DMVTD[playerid], string);
                }
        }

Crash line:

format(string, sizeof(string), "%s (~r~%d~w~) - l ~r~%d~w~~n~health: ~r~%.0f~w~~n~w: ~r~%d ~w~- jail: ~r~%d", N(id), id, playerVariables[id][pLevel], playerVariables[id][pHealth], playerVariables[id][pWanted], playerVariables[id][pJailed]);

What's the problem here?

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>