SA-MP Forums Archive
MySQL Plugin - 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 Plugin (/showthread.php?tid=409125)



MySQL Plugin - AarabMoney - 20.01.2013

I've started using the MySQL plugin R7 From BlueG for a while now in my gamemode and I've been able to use it properly un til I came across a few things that caused my server to crash. One function and one callback basically that killed my gamemode.

One of them was mysql_format, whenever I used %e in the string to protect the variables with mysql_real_escape_string, it caused the server to crash, but when I changed %e to %s it worked like a charm. Anyway to fix this?

Second one was, whenever I placed this little piece of snippet below in my filterscript it crashes the whole server when starting up the gamemode WITH the filterscript but when I load it in through RCON it works correctly. What I try to achieve is, is that I want to be able to load this filterscript when the gamemode gets resetted or loads as well.

Код:
public OnQueryFinish(query[], resultid, extraid, connectionHandle)
{
   
    return 1;
}
I'd appreciate help here if you know what might cause the issue, if I need to post more details then please say so, thanks in advance.


Re: MySQL Plugin - azzerking - 20.01.2013

1st Problem

%e doesn't stand for anything in pawn.

%s stands for string
%d stands for decimal
etc

%e isn't a data type.

2nd Problem

Im not quite sure I understand, what you mean? try explaining better.


Re: MySQL Plugin - AarabMoney - 20.01.2013

In the second problem this is what happens.

1) I place OnQueryFinish in my filterscript and compile it with no errors.
2) I go to server.cfg adding the filterscript in.
3) I start the server and I go in-game.
4) The first thing that I'm supposed to see is a login dialog from my gamemode but it doesn't.
5) I tab out to find out that my server is not on anymore, thus crashed.

When I remove the callback OnQueryFinish from my filterscript, the whole things loads properly as it should. It also works when I go in-game without loading in the filterscript first and then call the filterscript by using /rcon loadfs filterscript


Re: MySQL Plugin - azzerking - 20.01.2013

Please use the crash detector and post the errors from the log file located in the sa-mp directory.

LINK >> https://sampforum.blast.hk/showthread.php?tid=262796


Re: MySQL Plugin - Stevo127 - 20.01.2013

OnQueryFinish is not meant to be used with R7 I don't think.
You have to use mysql_function_query(); and send it to a function, created by yourself such as:

pawn Код:
mysql_function_query(connectionHandle, query, true, "OnQueryFinish", "i", playerid);
pawn Код:
forward OnQueryFinish(extraid);
public OnQueryFinish(extraid)
{
    return 1;
}



Re: MySQL Plugin - AarabMoney - 20.01.2013

Thanks for the help, I fixed it in a similar way as Stevo said