Source Mod Code
Code: Select all
#include <sourcemod>
#include <sdktools>
#include <cssclantags>
new g_iMaxClients = 0;
new Float:g_fTimer = 0.0;
new Handle:g_hBotClanTag = INVALID_HANDLE;
new GameType;
#define PLUGIN_VERSION "1.0.1"
public Plugin:myinfo =
{
name = "Bot Clan Tag",
author = "Smacked",
description = "Changes the clan of a BOT on the scoreboard",
version = PLUGIN_VERSION,
url = "N/A"
};
public OnPluginStart()
{
g_hBotClanTag = CreateConVar("bot_clantag", "BOT", "Bot ClanTag");
new String:szBuffer[100];
GetGameFolderName(szBuffer, sizeof(szBuffer));
if(StrEqual("cstrike", szBuffer))
GameType = true;
else if(StrEqual("dod", szBuffer))
GameType = false;
else
GameType = false;
}
public OnMapStart()
{
g_iMaxClients = GetMaxClients();
g_fTimer = 0.0;
}
public OnGameFrame()
{
if(g_fTimer < GetGameTime() - 0.1)
{
g_fTimer = GetGameTime();
for(new i = 1; i <= g_iMaxClients; i++)
{
if(!IsValidEdict(i) || !IsClientInGame(i) || !IsFakeClient(i))
continue;
if (GameType && IsFakeClient(i))
{
new String:Tag[255];
GetConVarString(g_hBotClanTag, Tag, sizeof(Tag));
CS_SetClientClanTag(i, Tag);
}
}
}
}