SA-MP Forums Archive
mysql shutdown - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mysql shutdown (/showthread.php?tid=608482)



mysql shutdown - Zevcore - 01.06.2016

Hello, after adding this to the script, the server immediately shuts down.

PHP код:
forward LoadBays();
public 
LoadBays()
{
    new 
query[128], data[128];
    
    
format(querysizeof query"SELECT * FROM `bays`");
    
mysql_query(query);
    
    
mysql_store_result();
    while(
mysql_fetch_row(data","))
    {
        
sscanf(data"p<,>ds[32]fff",
            
BayCache[bUID],
            
BayCache[bName],
            
BayCache[bPosX],
            
BayCache[bPosY],
            
BayCache[bPosZ]
        );
        
        
printf("%s"BayCache[bName]);
    }
    
    return 
1;

Table structure:



Re: mysql shutdown - Deroxi - 01.06.2016

Add crashdetect plugin, start the server again. Post the server_log.txt here


Re: mysql shutdown - Zevcore - 01.06.2016

PHP код:
[22:42:07] [debugServer crashed while executing gm.amx
[22:42:07] [debugAMX backtrace:
[
22:42:07] [debug#0 native mysql_query () from mysql.dll
[22:42:07] [debug#1 00009090 in public LoadBays () from gm.amx
[22:42:07] [debug#2 0000a5c0 in public zcmd_OnGameModeInit () from gm.amx
[22:42:07] [debug#3 native CallLocalFunction () from samp-server.exe
[22:42:07] [debug#4 00006048 in public SSCANF_OnGameModeInit () from gm.amx
[22:42:07] [debug#5 000003d4 in public OnGameModeInit () from gm.amx
[22:42:07] [debugNative backtrace:
[
22:42:07] [debug#0 10001a30 in ?? () from plugins\mysql.dll
[22:42:07] [debug#1 100032b4 in ?? () from plugins\mysql.dll
[22:42:07] [debug#2 004010b6 in ?? () from samp-server.exe
[22:42:07] [debug#3 616a62ca in ?? () from plugins\crashdetect.dll
[22:42:07] [debug#4 616a8b28 in ?? () from plugins\crashdetect.dll
[22:42:07] [debug#5 616a09c7 in ?? () from plugins\crashdetect.dll
[22:42:07] [debug#6 616a631a in ?? () from plugins\crashdetect.dll
[22:42:07] [debug#7 5ffc4469 in ?? () from plugins\streamer.dll
[22:42:07] [debug#8 004746be in ?? () from samp-server.exe
[22:42:07] [debug#9 004010b6 in ?? () from samp-server.exe
[22:42:07] [debug#10 616a62ca in ?? () from plugins\crashdetect.dll
[22:42:07] [debug#11 616a8b28 in ?? () from plugins\crashdetect.dll
[22:42:07] [debug#12 616a09c7 in ?? () from plugins\crashdetect.dll
[22:42:07] [debug#13 616a631a in ?? () from plugins\crashdetect.dll
[22:42:07] [debug#14 5ffc4469 in ?? () from plugins\streamer.dll
[22:42:07] [debug#15 0046f654 in ?? () from samp-server.exe
[22:42:07] [debug#16 65646f6d in ?? () from samp-server.exe
[22:42:07] [debug#17 6d672f73 in ?? () from samp-server.exe
[22:42:07] [debug#18 786d612e in ?? () from samp-server.exe 



Re: mysql shutdown - Deroxi - 01.06.2016

And what about the mysql_log.txt? Does that give any information?


Re: mysql shutdown - Zevcore - 01.06.2016

PHP код:
[Wed Jun 01 22:46:32 2016] -------------------------
[
Wed Jun 01 22:46:32 2016]      Logging Started
[Wed Jun 01 22:46:32 2016] ------------------------- 



Re: mysql shutdown - Deroxi - 01.06.2016

Thats all? Odd


Re: mysql shutdown - Zevcore - 01.06.2016

Yep, no more.


Re: mysql shutdown - ilijap - 01.06.2016

Huh.

Код:
forward LoadBays();
public LoadBays()
{
    new query[128], data[128];
    mysql_query(conhandlegoeshere, SELECT * FROM `bays`);
    new rows = cache_num_rows(), id = 0;
    for(new id = 0, rows=cache_num_rows(); id < rows; id++)
    {
        format(query, sizeof query, "SELECT * FROM `bays` WHERE id='%d'", id);
        mysql_query(query);
        new row = cache_num_rows();
        if(row != 0)
        {
          BayCache[bUID] = cache_get_field_content_int(0,"uid", urchandlehere);
          cache_get_field_content(0, "name", BayCache[bName], urchandlehere, sizeofwillnotworkhereaddmanually)
          BayCache[bPosX] = cache_get_field_content_float(0, "posX", urchandlehere);
          BayCache[bPosY] = cache_get_field_content_float(0, "posY", urchandlehere);
          BayCache[bPosZ] = cache_get_field_content_float(0, "posZ", urchandlehere);
        }
    }
    printf("%s", BayCache[bName]);
    return 1;
}



Re: mysql shutdown - justjamie - 01.06.2016

Show us your OnGamemodeInit


Re: mysql shutdown - Zevcore - 02.06.2016

ilijap, didn't work.

PHP код:
public OnGameModeInit()
{
        
ConnectDatabase();
    
LoadBays();
    return 
1;