[18:13:32] [npc:join] [Bomb][Shop] has joined the server (0:127.0.0.1)
[18:13:47] [debug] Server crashed while executing MyMode.amx
[18:13:47] [debug] AMX backtrace:
[18:13:47] [debug] #0 native fclose () [004056f0] from samp-server.exe
[18:13:47] [debug] #1 0000049c in ?? (0x0009a0b0, 0x00479c60) from MyMode.amx
[18:13:47] [debug] #2 0007a51c in ?? (0x00000000) from MyMode.amx
[18:13:47] [debug] #3 00045550 in public Itter_OnPlayerDisconnect (0x00000000, 0x00000000) from MyMode.amx
[18:13:47] [debug] #4 00016418 in public Streamer_OnPlayerDisconnect (0x00000000, 0x00000000) from MyMode.amx
[18:13:48] [debug] #5 000158f4 in public SSCANF_OnPlayerDisconnect (0x00000000, 0x00000000) from MyMode.amx
[18:13:48] [debug] #6 0000fd58 in ?? (0x00000000, 0x00000000) from MyMode.amx
[18:13:48] [debug] #7 0000a528 in public OnPlayerDisconnect (0x00000000, 0x00000000) from MyMode.amx
[18:13:48] [debug] Native backtrace:
[18:13:48] [debug] #0 00492d8b in ?? () from C:\Users\benel\Desktop\Server 0.3x\samp-server.exe
[18:13:48] [debug] #1 004056fd in ?? () from C:\Users\benel\Desktop\Server 0.3x\samp-server.exe
[18:13:48] [debug] #2 6e5960ba in ?? () from C:\Users\benel\Desktop\Server 0.3x\plugins\crashdetect.DLL
[18:13:48] [debug] #3 6e597fee in ?? () from C:\Users\benel\Desktop\Server 0.3x\plugins\crashdetect.DLL
[18:13:48] [debug] #4 6e590091 in ?? () from C:\Users\benel\Desktop\Server 0.3x\plugins\crashdetect.DLL
[18:13:48] [debug] #5 6e59610a in ?? () from C:\Users\benel\Desktop\Server 0.3x\plugins\crashdetect.DLL
[18:13:48] [debug] #6 0046c61b in ?? () from C:\Users\benel\Desktop\Server 0.3x\samp-server.exe
#include <a_npc>
main() {}
NextPlayback()
return StartRecordingPlayback(PLAYER_RECORDING_TYPE_ONFOOT, "BombShop");
public OnNPCSpawn() return NextPlayback();
public OnRecordingPlaybackEnd() return NextPlayback();
Are you sure it's the NPC? In the crash log I see something about 'fclose', are there any files the script tries to use which don't exist? Try removing the NPC, and see if it still crashes, be sure to check the thing about the files aswell.
|
Are you sure it's the NPC? In the crash log I see something about 'fclose', are there any files the script tries to use which don't exist? Try removing the NPC, and see if it still crashes, be sure to check the thing about the files aswell.
|
True. It's like it gets crashed when the function fclose is being called in OnPlayerDisconnect.
Would you mind to show us the OnPlayerDisconnect callback in your MyMode.pwn file? |
public OnPlayerDisconnect(playerid, reason)
{
sI[ConnectedPlayers]--;
return SavePlayerData(playerid);
}
stock SavePlayerData(playerid)
{
if(!DOF2_FileExists(PFile(playerid))) DOF2_CreateFile(PFile(playerid));
DOF2_SetInt(PFile(playerid), "Password", pI[playerid][Password]);
DOF2_SetString(PFile(playerid), "IP", pI[playerid][Ip]);
DOF2_SetString(PFile(playerid), "Tag", pI[playerid][Tag]);
DOF2_SetString(PFile(playerid), "Date", pI[playerid][Date]);
DOF2_SetString(PFile(playerid), "Name", pI[playerid][RealName]);
DOF2_SetString(PFile(playerid), "City", pI[playerid][City]);
DOF2_SetString(PFile(playerid), "Skype", pI[playerid][Skype]);
DOF2_SetString(PFile(playerid), "Email", pI[playerid][Email]);
DOF2_SetInt(PFile(playerid), "Kills", pI[playerid][Kills]);
DOF2_SetInt(PFile(playerid), "Deaths", pI[playerid][Deaths]);
DOF2_SetInt(PFile(playerid), "Money", pI[playerid][Money]);
for(new i; i < 27; i++)
{
format(g_String, sizeof g_String, "WeaponID: %i", i);
DOF2_SetInt(PFile(playerid), g_String, pI[playerid][PlayerWeapons][i]);
format(g_String, sizeof g_String, "WeaponAmmo: %i", i);
DOF2_SetInt(PFile(playerid), g_String, pI[playerid][PlayerAmmo][i]);
}
DOF2_SetInt(PFile(playerid), "PursuitWining", pI[playerid][PursuitWining]);
DOF2_SetInt(PFile(playerid), "MiniWining", GetPVarInt(playerid, "MiniWining"));
DOF2_SetInt(PFile(playerid), "WarWining", GetPVarInt(playerid, "WarWining"));
DOF2_SetInt(PFile(playerid), "SWarWining", GetPVarInt(playerid, "SWarWining"));
DOF2_SetInt(PFile(playerid), "TWarWining", GetPVarInt(playerid, "TWarWining"));
DOF2_SetInt(PFile(playerid), "BoomWining", GetPVarInt(playerid, "BoomWining"));
DOF2_SetInt(PFile(playerid), "BazookaWining", GetPVarInt(playerid, "BazookaWining"));
DOF2_SetInt(PFile(playerid), "Level", pI[playerid][Level]);
DOF2_SetInt(PFile(playerid), "Age", pI[playerid][Age]);
DOF2_SetBool(PFile(playerid), "Admin", pI[playerid][Admin]);
DOF2_SetBool(PFile(playerid), "Helper", pI[playerid][Helper]);
DOF2_SetBool(PFile(playerid), "HaveCar", pI[playerid][HaveCar]);
if(IsBAdmin(playerid)) DOF2_SetInt(PFile(playerid), "AdminLevel", pI[playerid][AdminLevel]);
if(pI[playerid][HaveCar])
{
DOF2_SetString(PFile(playerid), "CarName", pI[playerid][PlayerCarName]);
DOF2_SetInt(PFile(playerid), "CarID", pI[playerid][CarID]);
}
if(!pI[playerid][HaveCar] && DOF2_IsSet(PFile(playerid), "CarID")) DOF2_Unset(PFile(playerid), "CarID");
GetName(playerid) = EOS;
PFile(playerid) = EOS;
GetpIP(playerid) = EOS;
if(IsBAdmin(playerid))
{
IsBAdmin(playerid) = false;
IsBLevel(playerid) = EOS;
}
return DOF2_SaveFile();
}
I've never used DOF2 before but I'm sure that the crash is coming from the SavePlayerData function.
It's either by DOF2_SaveFile() (it might use fclose after saving into the file) or some of the functions like: PFile(playerid) etc. If you're not busy, would you mind to load the version of the crashdetect (4.11.2) if you're using an older one (It can be found here: https://github.com/Zeex/samp-plugin-...es/tag/v4.11.2) And do what this post (http://forum.sa-mp.com/showpost.php?...32&postcount=7) says. It might gives extra information related to the crash; for example, the line is caused at. |
I don't undarstand this: http://forum.sa-mp.com/showpost.php?...32&postcount=7 :\
|
-d3
Create a file pawn.cfg in the pawno directory (where pawno.exe is located) and open the file. Write inside:
pawn Код:
|
[20:26:25] [npc:join] [Bomb][Shop] has joined the server (0:127.0.0.1)
[20:26:40] [debug] Server crashed while executing MyMode.amx
[20:26:40] [debug] AMX backtrace:
[20:26:40] [debug] #0 native fclose () [004056f0] from samp-server.exe
[20:26:40] [debug] #1 00000520 in DOF2_CreateFile (file[]=@0x0009a038 "", password[]=@0x00479be8 "") at C:\Users\benel\Desktop\Server 0.3x\pawno\include\DOF2.inc:277
[20:26:40] [debug] #2 00097c58 in SavePlayerData (playerid=0) at C:\Users\benel\Desktop\Server 0.3x\gamemodes\MyMode.pwn:6321
[20:26:40] [debug] #3 00055ac8 in public Itter_OnPlayerDisconnect (playerid=0, reason=0) at C:\Users\benel\Desktop\Server 0.3x\gamemodes\MyMode.pwn:2816
[20:26:40] [debug] #4 0001a960 in public Streamer_OnPlayerDisconnect (playerid=0, reason=0) at C:\Users\benel\Desktop\Server 0.3x\pawno\include\YSI\y_iterate.inc:909
[20:26:40] [debug] #5 00019ac4 in public SSCANF_OnPlayerDisconnect (... <2 arguments>) at C:\Users\benel\Desktop\Server 0.3x\pawno\include\streamer.inc:297
[20:26:40] [debug] #6 00013280 in ?? (... <2 arguments>) at C:\Users\benel\Desktop\Server 0.3x\pawno\include\sscanf2.inc:182
[20:26:40] [debug] #7 0000cca4 in public OnPlayerDisconnect (playerid=0, reason=0) at C:\Users\benel\Desktop\Server 0.3x\pawno\include\YSI\y_hooks/impl.inc:661
[20:26:41] [debug] Native backtrace:
[20:26:41] [debug] #0 00492d8b in ?? () from C:\Users\benel\Desktop\Server 0.3x\samp-server.exe
[20:26:41] [debug] #1 004056fd in ?? () from C:\Users\benel\Desktop\Server 0.3x\samp-server.exe
[20:26:41] [debug] #2 6e4d60ba in ?? () from C:\Users\benel\Desktop\Server 0.3x\plugins\crashdetect.DLL
[20:26:41] [debug] #3 6e4d7fee in ?? () from C:\Users\benel\Desktop\Server 0.3x\plugins\crashdetect.DLL
[20:26:41] [debug] #4 6e4d0091 in ?? () from C:\Users\benel\Desktop\Server 0.3x\plugins\crashdetect.DLL
[20:26:41] [debug] #5 6e4d610a in ?? () from C:\Users\benel\Desktop\Server 0.3x\plugins\crashdetect.DLL
[20:26:41] [debug] #6 0046c61b in ?? () from C:\Users\benel\Desktop\Server 0.3x\samp-server.exe