Updating to 0.3.7
#1

Код:
[23:38:41] [debug] Server crashed while executing DM.amx
[23:38:41] [debug] AMX backtrace:
[23:38:42] [debug] #0 native fwrite () from samp-server.exe
[23:38:42] [debug] #1 000425b4 in public CB_OnGameModeInit () at DM.pwn:3925
[23:38:42] [debug] #2 00023f28 in public zcmd_OnGameModeInit () at E:\Scripting\SA-MP Releated Stuff\Game Modes\TVM\pawno\include\callbacks.inc:444
[23:38:42] [debug] #3 native CallLocalFunction () from samp-server.exe
[23:38:42] [debug] #4 00022034 in ?? () at E:\Scripting\SA-MP Releated Stuff\Game Modes\TVM\pawno\include\zcmd.inc:68
[23:38:42] [debug] #5 0000e614 in public Itter_OnGameModeInit () at E:\Scripting\SA-MP Releated Stuff\Game Modes\TVM\pawno\include\YSI\y_hooks/impl.inc:484
[23:38:42] [debug] #6 native CallLocalFunction () from samp-server.exe
[23:38:42] [debug] #7 000086ec in public ScriptInit_OnGameModeInit () at E:\Scripting\SA-MP Releated Stuff\Game Modes\TVM\pawno\include\YSI\y_iterate.inc:791
[23:38:42] [debug] #8 0000730c in public SSCANF_OnGameModeInit () at E:\Scripting\SA-MP Releated Stuff\Game Modes\TVM\pawno\include\YSI\internal\..\y_scriptinit.inc:171
[23:38:42] [debug] #9 000009b8 in public OnGameModeInit () at E:\Scripting\SA-MP Releated Stuff\Game Modes\TVM\pawno\include\sscanf2.inc:205
[23:38:42] [debug] Native backtrace:
[23:38:42] [debug] #0 77057413 in ?? () from C:\WINDOWS\SYSTEM32\ntdll.dll
[23:38:42] [debug] #1 004956b0 in ?? () from samp-server.exe
[23:38:42] [debug] #2 0040534e in ?? () from samp-server.exe
The callbacks include https://sampforum.blast.hk/showthread.php?tid=490436 no idea why this error is caused. And moreover i updated the loops.

pawn Код:
public OnGameModeInit()
{
    zcmd_g_HasOPCS = funcidx("OnPlayerCommandReceived") != -1;
    zcmd_g_HasOPCE = funcidx("OnPlayerCommandPerformed") != -1;
    if (funcidx("zcmd_OnGameModeInit") != -1)
    {
        return CallLocalFunction("zcmd_OnGameModeInit", ""); (error line in zcmd include)
    }  
    return 1;
}
pawn Код:
public OnGameModeInit()
{
    Callback_Initialize();

    #if defined CB_OnGameModeInit
        return CB_OnGameModeInit(); (error line in callbacks include)
    #else
        return 1;
    #endif
}
Reply
#2

Its fwrite handling an invalid file...

fwrite crashes the server if you don't correctly open the file and don't check that the file was correctly opened.

You most likely did:
pawn Код:
new File:f = fopen("file.format", io_write);
fwrite(f, "hi");
fclose(f);
The correct way is to handle the file:

pawn Код:
new File:f = fopen("file.format", io_write);
if (f)
{
    fwrite(f, "hi");
    fclose(f);
}
Reply
#3

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
Its fwrite handling an invalid file...

fwrite crashes the server if you don't correctly open the file and don't check that the file was correctly opened.

You most likely did:
pawn Код:
new File:f = fopen("file.format", io_write);
fwrite(f, "hi");
fclose(f);
The correct way is to handle the file:

pawn Код:
new File:f = fopen("file.format", io_write);
if (f)
{
    fwrite(f, "hi");
    fclose(f);
}
ah thanks lol i totally forgot these things can crash server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)