SA-MP Forums Archive
[MYSQL] Once the function is loaded, the server crashes. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [MYSQL] Once the function is loaded, the server crashes. (/showthread.php?tid=123731)



[MYSQL] Once the function is loaded, the server crashes. - Eazy_Efolife - 27.01.2010

Hi, I've been trying to find this problem for a while now, I debugged the function and noticed the whole function makes the server crash (( Not just a part of it )). Anyone got an idea why it's crashing?

pawn Код:
stock LoadMaps()
{
  mysql_query("SELECT * FROM `Maps`");
  mysql_store_result();
  new idx;
  while (idx < sizeof(MapInfo))
  {
        mysql_fetch_row_format(resultline,"|");
        split(resultline, player, '|');

      MapInfo[idx][Model] = strval(player[0]);
      MapInfo[idx][X] = floatstr(player[1]);
      MapInfo[idx][Y] = floatstr(player[2]);
      MapInfo[idx][Z] = floatstr(player[3]);
      MapInfo[idx][RX] = floatstr(player[4]);
      MapInfo[idx][RY] = floatstr(player[5]);
      MapInfo[idx][RZ] = floatstr(player[6]);
      CreateObject(MapInfo[idx][Model], MapInfo[idx][X], MapInfo[idx][Y], MapInfo[idx][Z], MapInfo[idx][RX], MapInfo[idx][RY], MapInfo[idx][RZ]);
      idx++;
    }
}




Re: [MYSQL] Once the function is loaded, the server crashes. - Chaprnks - 27.01.2010

Try looking into the mysql_debug log. Most likely would be caused by Model not being loaded correctly and creating an object with the ID of 0.


Re: [MYSQL] Once the function is loaded, the server crashes. - Eazy_Efolife - 27.01.2010

Quote:
Originally Posted by Chaprnks
Try looking into the mysql_debug log. Most likely would be caused by Model not being loaded correctly and creating an object with the ID of 0.
Nothing, this what just shows up:
Код:
[22:33:42] 

[22:33:42] ---------------------------

[22:33:42] MySQL Debugging activated (01/26/10)

[22:33:42] ---------------------------

[22:33:42]



Re: [MYSQL] Once the function is loaded, the server crashes. - Eazy_Efolife - 27.01.2010

Bump


Re: [MYSQL] Once the function is loaded, the server crashes. - Eazy_Efolife - 27.01.2010

Quote:
Originally Posted by Seif_
Hm, maybe you can't just do SELECT * FROM Maps, you probably need to select a field to load.
Still crashes