some one can help me for fix this plugin , cause he crash my server ...
PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <smlib>
new Handle:DB = INVALID_HANDLE;
new String:Error[100];
public Plugin:myinfo = {
name = "MySQL",
author = "Skuzy",
description = "",
url = ""
};
public OnPluginStart()
{
DB = SQL_Connect("test", true, Error, sizeof(Error));
if(DB == INVALID_HANDLE)
{
PrintToServer("Cannot connect to MySQL Server: %s", Error);
CloseHandle(DB);
} else {
PrintToServer("Connection Successful");
}
RegConsoleCmd("sm_clantag",CallBack_clantag);
}
GetClientPrefix(client, String:prefix[32])
{
new String:steamid[32];
GetClientAuthString(client, steamid, 32);
new String:query[150];
Format(query, sizeof(query), "SELECT prefix FROM chatcolor WHERE steamid='%s'", steamid);
SQL_LockDatabase(DB);
new Handle:queryH = SQL_Query(DB, query);
SQL_LockDatabase(DB);
SQL_FetchRow(queryH);
SQL_FetchString(queryH, 0, prefix, sizeof(prefix));
CloseHandle(queryH);
}
public Action:CallBack_clantag(client,args)
{
new String:NewPrefix[32];
GetClientPrefix(client, NewPrefix);
CS_SetClientClanTag(client, NewPrefix);
}