We're trying it with the following code, but it isn't really responding
PHP Code:
#include <sourcemod>
public Plugin:myinfo =
{
name = "Authentication",
author = " ",
description = "Client Authentication",
version = "1.0.0.0",
url = " "
};
public OnPluginStart()
{
}
new Handle:hDatabase = INVALID_HANDLE;
StartSQL()
{
SQL_TConnect(GotDatabase);
}
public GotDatabase(Handle:owner, Handle:hndl, const String:error[], any:data)
{
if (hndl == INVALID_HANDLE)
{
LogError("Database failure: %s", error);
} else {
hDatabase = hndl;
}
}
CheckSteamID(userid, const String:auth[], maxstrlen)
{
decl String:query[255];
Format(query, sizeof(query), "SELECT steamid FROM cpay_users WHERE steamid = '%s'", auth);
SQL_TQuery(hdatabase, T_CheckSteamID, query, userid)
}
public T_CheckSteamID(Handle:owner, Handle:hndl, const String:error[], any:data)
{
new client;
/* Make sure the client didn't disconnect while the thread was running */
if ((client = GetClientOfUserId(data)) == 0)
{
return;
}
if (hndl == INVALID_HANDLE)
{
LogError("Query failed! %s", error);
KickClient(client, "Authorization failed");
} else if (!SQL_GetRowCount(hndl)) {
KickClient(client, "You are not a member");
}
}
Pleeeaase help us out here!!