Hello,
I am following the example from the docs:
Code:
Database hDatabase = null;
void StartSQL()
{
Database.Connect(GotDatabase);
}
public void GotDatabase(Database db, const char[] error, any data)
{
PrintToServer("Got database2"); // <--- this won't actually happen until I do: sm plugins unload myplugin
if (db == null)
{
LogError("Database failure: %s", error);
}
else
{
hDatabase = db;
}
}
But, for some odd reason, the "GotDatabase" is not invoked unless I unload the plugin.
In the GotDatabase function I am calling "PrintToServer", and also I am inserting a row to the db. I monitor both the server console, and the table in the db and nothing happens UNLESS I unload the plugin.
What am I doing wrong?