crashdetect
#1

pawn Код:
[OnGameModeExit] Shutting down...
[19:18:22] [debug] Server crashed while executing ScavengeSurvive.amx
[19:18:22] [debug] AMX backtrace:
[19:18:22] [debug] #0 native fread () from samp-server.exe
[19:18:22] [debug] #1 003035b8 in ?? () at C:\Users\Shitcomputer\Desktop\Server\gamemodes\ScavengeSurvive.pwn:615
[19:18:22] [debug] #2 0000f540 in public ScriptInit_OnGameModeExit () at C:\Users\Shitcomputer\Desktop\Server\pawno\include\YSI\y_hooks/impl.inc:516
[19:18:22] [debug] #3 00007674 in public OnGameModeExit () at C:\Users\Shitcomputer\Desktop\Server\pawno\include\YSI\internal\..\y_scriptinit.inc:269
[19:18:23] [debug] Native backtrace:
[19:18:23] [debug] #0 76eb77a2 in ?? () from C:\Windows\SYSTEM32\ntdll.dll
[19:18:23] [debug] #1 004943b0 in ?? () from samp-server.exe
[19:18:23] [debug] #2 004949e0 in ?? () from samp-server.exe
[19:18:23] [debug] #3 00404f14 in ?? () from samp-server.exe
Reply
#2

https://sampwiki.blast.hk/wiki/Fread

Read the "Warning" box because that's the reason your server crash.

There are also examples below it so you can understand how to prevent it (by checking if the file handle is valid).

PS: It's in the line 615.
Reply
#3

public OnGameModeExit()
{
print("\n[OnGameModeExit] Shutting down...");

new File:f = fopen("nonexistentfile", io_read), _s[1];
fread(f, _s); // 615 Line
fclose(f);

return 1;
}
Reply
#4

PHP код:
new File:fopen("nonexistentfile"io_read), _s[1];
if (
f)
{
    
fread(f_s); // 615 Line
    
fclose(f);

Reply
#5

That did not work, the server still restarts
Reply
#6

Quote:
Originally Posted by FinStar
Посмотреть сообщение
That did not work, the server still restarts
There is a difference between server crash and server restart. File functions crash the server with invalid handles. If the file was not opened correctly, it'll just not write/read and close the file to prevent it (that's what the code does).

If your server restarting for an unknown reason, the problem is somewhere else.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)