Pawn Compiler Library has stopped working. [MySQL] - 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: Pawn Compiler Library has stopped working. [MySQL] (
/showthread.php?tid=604108)
Pawn Compiler Library has stopped working. [MySQL] -
Melktert - 31.03.2016
For some reason, pawncc.exe crashes because of this coding...
Код:
if(Logged[playerid] == 1)
{
//If the player disconnects before registering,
//we want to make sure it doesn't try update
//so we check if the player is logged in.
new score = GetPlayerScore(playerid); //Gets players score
new money = GetPlayerMoney(playerid); //Gets players money
new query[200], pname[24]; //Creates the variables
GetPlayerName(playerid, pname, 24); //Gets the players name.
format(query, sizeof(query), "UPDATE playerdata SET score=%d, money=%d WHERE user='%s'", score, money, pname);
mysql_query(query);
//No need to store a result for a update string
Re: Pawn Compiler Library has stopped working. [MySQL] -
Antoniohl - 31.03.2016
change
Quote:
format(query, sizeof(query), "UPDATE playerdata SET score=%d, money=%d WHERE user='%s'", score, money, pname);
|
to this
Quote:
format(query, sizeof(query), "UPDATE `playerdata` SET `score` = '%d', `money` = '%d' WHERE `user` = '%s'", score, money, pname);
|
and make sure to close the brackets
Re: Pawn Compiler Library has stopped working. [MySQL] -
Melktert - 31.03.2016
Still not working, when I comment out those lines, it doesn't crash. But still gives errors (which I will fix)
Re: Pawn Compiler Library has stopped working. [MySQL] -
Antoniohl - 31.03.2016
If you can't fix them post and i will do my best.
Re: Pawn Compiler Library has stopped working. [MySQL] -
Melktert - 31.03.2016
I just uncommented the lines to see if this was the problem, I still need helping fixing these lines, whatever's wrong with them.
Re: Pawn Compiler Library has stopped working. [MySQL] -
czerwony03 - 31.03.2016
Show errors, maybe you lost some brackets somewhere?
Re: Pawn Compiler Library has stopped working. [MySQL] -
introzen - 31.03.2016
I'm no MySQL expert but I believe a connectionhandle under mysql_query is necessary.
Re: Pawn Compiler Library has stopped working. [MySQL] -
czerwony03 - 31.03.2016
@up
Some plugins don't need connection handle in mysql_query();
Re: Pawn Compiler Library has stopped working. [MySQL] -
iKevin - 31.03.2016
Quote:
Originally Posted by czerwony03
@up
Some plugins don't need connection handle in mysql_query();
|
Most of them do.