[Crashdetect Code Included] Help anyone?
#1

Quote:

[ [debug] Server crashed while executing C-Basic.amx
[ [debug] AMX backtrace:
[ [debug] #0 native fclose () [004056c0] from samp-server.exe
[ [debug] #1 00013b28 in ?? () from C-Basic.amx
[ [debug] #2 00053418 in ?? () from C-Basic.amx
[ [debug] #3 00056f30 in ?? () from C-Basic.amx
[ [debug] #4 0001d2c8 in public OnDialogResponse () from C-Basic.amx
[ [debug] Native backtrace:
[ [debug] #0 0049316b in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe
[ [debug] #1 004056cd in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe
[ [debug] #2 00bc350a in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll
[ [debug] #3 00bc51a6 in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll
[ [debug] #4 00bbd641 in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll
[ [debug] #5 00bc355a in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll
[ [debug] #6 0046dac1 in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe
[ [debug] #7 00452850 in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe
[ [debug] #8 0012fd5c in ?? ()
[ [debug] #9 01080022 in ?? ()

(Yes, I removed the timestamp...) I need someone to help me... please?
Reply
#2

Replace such files with updated ones.
Reply
#3

What do you mean? C-Basic is my gamemode...
Reply
#4

fclose function crashed your server.

Quote:
Originally Posted by SA-MP Wiki
Important Note: The file handle must be valid, and must point to a file successfully opened by fopen.
Example:
pawn Код:
new
    File: fhandle = fopen("somefile.txt", io_append);
if (fhandle) // It opened the file successfully
{
    fwrite(fhandle, "blabla..");
    fclose(fhandle);
}
You used fclose out of that check (whether the file opened successfully (valid) or not). The only hint it gives is that it was used in OnDialogResponse so update crashdetect to its latest version (4.12): https://github.com/Zeex/samp-plugin-...ases/tag/v4.12

and at the next crash, post what it printed.
Reply
#5

Quote:

[ [debug] Server crashed while executing C-Basic.amx
[ [debug] AMX backtrace:
[ [debug] #0 native fclose () [004056c0] from samp-server.exe
[ [debug] #1 00013b28 in ?? (0x00000000) from C-Basic.amx
[ [debug] #2 00053418 in ?? (0x00000000) from C-Basic.amx
[ [debug] #3 00056f30 in ?? (0x00000000, 0x00000064, 0x00000001, 0xffffffff, 0x011ab2bc) from C-Basic.amx
[ [debug] #4 0001d2c8 in public OnDialogResponse (0x00000000, 0x00000064, 0x00000001, 0xffffffff, 0x011ab2bc) from C-Basic.amx
[ [debug] Native backtrace:
[ [debug] #0 0049316b in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe
[ [debug] #1 004056cd in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe
[ [debug] #2 00bc5f2a in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll
[ [debug] #3 00bc822e in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll
[ [debug] #4 00bbff6f in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll
[ [debug] #5 00bc5f7a in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\plugins\crashdetect.dll
[ [debug] #6 0046dac1 in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe
[ [debug] #7 00452850 in ?? () from C:\Program Files\Rockstar Games\SA-MP Servers\New Gamemode\samp-server.exe
[ [debug] #8 0012fd5c in ?? ()
[ [debug] #9 010801b0 in ?? ()

Pretty much the same thing...
Reply
#6

pawn Код:
if(dialogid == REGISTER_DIALOG)
    {
        if(!response) return Kick(playerid);
        else
        {
            if(!strlen(inputtext))
            {
                ShowPlayerDialog(playerid,REGISTER_DIALOG, DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\n\nYou left the password blank.","Register","");
                return 1;
            }
            else
            {
                new nPass[130];
                WP_Hash(nPass, sizeof(nPass), inputtext);
                pData[playerid][Password] = nPass;
                SavePlayerData(playerid);
                ShowPlayerDialog(playerid, LOGIN_DIALOG, DIALOG_STYLE_PASSWORD, "Login", "Thank you for registering.\nEnter your password to login.", "Login", "");
            }
            return 1;
        }
    }

Thats my register dialog...

Heres my SavePlayerData

pawn Код:
stock SavePlayerData(playerid)
{
    SaveBackPack(playerid);
    SaveTeleports(playerid);
    new INI:file = INI_Open(Path(playerid));
    INI_SetTag(file,"Player's Data");

    INI_WriteString(file,"Password",pData[playerid][Password]);
    INI_WriteFloat(file,"Health",GetPlayerHealthReturn(playerid), 2);
    INI_WriteFloat(file,"Armour",GetPlayerArmourReturn(playerid), 2);
    INI_WriteInt(file,"Level",pData[playerid][Level]);
    INI_WriteInt(file,"Money",GetPlayerMoney(playerid));
    INI_WriteInt(file,"Score",GetPlayerScore(playerid));
    INI_WriteInt(file,"Kills",pData[playerid][Kills]);
    INI_WriteInt(file,"Deaths",pData[playerid][Deaths]);
    INI_Close(file);
    return 1;
}
Reply
#7

I don't think YSI would have that mistake. Most of the times, it's caused by using standard file functions like the example I gave you. And also only from the callback is not that easy to find the problem sometimes.
Reply
#8

Ok, well i figured out that it is the SavePlayerData function... Do you see anything wrong with it? When i remove it, the server doesnt crash... So it HAS to be that function...
Reply
#9

It may be caused by SaveBackPack or SaveTeleports. Can you post those too?
Reply
#10

They are from my copies of an inventory script here on the forum somewhere. I nested those two lines (/* and */) and it still crashed...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)