Trying to replace/add clan tag to once who found in db
not really working , can you guys take a look please
PHP Code:
#include <sourcemod>
#include <cstrike>
#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];
GetClientAuthId(client, AuthId_Engine, sAuth, sizeof(sAuth));
FormatEx(sQuery, sizeof(sQuery), "SELECT steam FROM suspects WHERE steam = '%s'", sAuth);
SQL_TQuery(db, SQL_LoadClient, sQuery, GetClientUserId(client));
}
public SQL_LoadClient(Handle:hOwner, Handle:hQuery, const String:sError[], any:UserID)
{
if (hQuery == INVALID_HANDLE || sError[0])
{
LogError("SQL_LoadClient: %s", sError);
}
new client = GetClientOfUserId(UserID);
if ( client && SQL_FetchRow(hQuery))
{
if(!SQL_FetchInt(hQuery, 0))
{
CS_SetClientClanTag(client, "[SUSPECTED]");
}
}
}