#include <dbi> ?
edit: give it a try
PHP Code:
#include <sourcemod>
#include <cstrike>
#include <dbi>
#define PLUGIN_VERSION "1.0"
public Plugin:myinfo = {
name = "suspect checker",
author = "forums.alliedmods.net",
description = "suspect checker",
version = PLUGIN_VERSION,
url = "forums.alliedmods.net"
};
new Handle:db;
public OnPluginStart()
{
new String:error[512];
db = SQL_Connect("default", true, error, sizeof(error));
if(db == INVALID_HANDLE)
{
SetFailState(error);
}
}
public OnClientPostAdminCheck(client)
{
decl String:sQuery[256], String:sAuth[32];
new data;
GetClientAuthId(client, AuthId_Engine, sAuth, sizeof(sAuth));
data = GetClientOfUserId(client);
FormatEx(sQuery, sizeof(sQuery), "SELECT steam FROM suspects WHERE steam = '%s'", sAuth);
SQL_TQuery(db, SQL_LoadClient, sQuery, data);
}
public SQL_LoadClient(Handle:hOwner, Handle:hQuery, const String:sError[], any:data)
{
new client = data;
if (hQuery == INVALID_HANDLE || sError[0])
{
LogError("SQL_LoadClient: %s", sError);
}
if ( client && SQL_FetchRow(hQuery))
{
if(!SQL_FetchInt(hQuery, 0))
{
CS_SetClientClanTag(client, "[SUSPECTED]");
}
}
}