SA-MP Forums Archive
Server crashed due to an unknown error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: Server crashed due to an unknown error (/showthread.php?tid=569794)



Server crashed due to an unknown error - S4t3K - 02.04.2015

Hey !

I tried to code a plugin today, using Kyosaur's tut and Zeex's sampgdk plugin.

Though, when I start the server, it crashes. Then, I decided to load crashdetect to locate the crash source, and it displays me this :

Код:
[22:21:59]   Loading filterscript 'test_fs.amx'... // the filterscript where I test the natives I added
[22:22:00] [debug] Server crashed due to an unknown error
[22:22:00] [debug] Native backtrace:
[22:22:00] [debug] #0 0f2e1b92 in AmxLoad () from plugins\plugin.dll
[22:22:00] [debug] #1 00469205 in ?? () from samp-server.exe
The strange thing here is that my AmxLoad function contains nothing unusual :

PHP код:

AMX_NATIVE_LIST natives
[] =
{
      {
"IsVirtualKeyPressed"IsVirtualKeyPressed_},
      
// more natives
      
NULLNULL }
};
PLUGIN_EXPORT int PLUGIN_CALL AmxLoad(AMX *amx)
{
    return 
amx_Register(amxnatives, -1);

It compiled with no errors in Visual Studio 2013.

Full code here : http://pastebin.com/79qEH8id


Respuesta: Server crashed due to an unknown error - JustBored - 02.04.2015

show us the full code or at least some parts that can be useful to fix the issue


Re : Server crashed due to an unknown error - S4t3K - 02.04.2015

The fact is that I don't know how the issue happens - and thus can't show you specific parts of my code.

If you want the full code, here it is : http://pastebin.com/79qEH8id


Re: Server crashed due to an unknown error - kurta999 - 02.04.2015

Interesting, beucase for me it helped a lot already. Even if plugin compiled with debug info..


Re: Server crashed due to an unknown error - kurta999 - 02.04.2015

Like everybody


Re: Server crashed due to an unknown error - xeeZ - 03.04.2015

Did you initialize pAMXFunctions? All AMX functions are called through this variable (see amxplugin.cpp).


Re: Server crashed due to an unknown error - vermaritt - 03.04.2015

Yea Zeex is right, you should add "extern void *pAMXFunctions;" above the player data structure.


Re : Server crashed due to an unknown error - S4t3K - 03.04.2015

I did not initialize it. And this was the problem. Thanks @Zeex !