PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
public Plugin:myinfo = {
name = "Hide SourceTV",
author = "bl4nk",
description = "Hides SourceTV from the scoreboard",
version = "1.0.0",
url = "http://forums.alliedmods.net/"
};
public OnMapStart() {
new iIndex = FindEntityByClassname(MaxClients+1, "tf_player_manager");
if (iIndex == -1) {
SetFailState("Unable to find player manager entity");
}
SDKHook(iIndex, SDKHook_ThinkPost, Hook_OnThinkPost);
}
public Hook_OnThinkPost(iEnt) {
static iConnectedOffset = -1;
if (iConnectedOffset == -1) {
iConnectedOffset = FindSendPropInfo("CTFPlayerResource", "m_bConnected");
}
new iConnected[35];
GetEntDataArray(iEnt, iConnectedOffset, iConnected, 35);
for (new i = 1; i < 35; i++) {
if (iConnected[i] && IsFakeClient(i)) {
iConnected[i] = 0;
}
}
SetEntDataArray(iEnt, iConnectedOffset, iConnected, 35);
}
For TF2, requires the SDK Hooks extension. This hides all fake clients (bots) on the scoreboard, so if you for whatever reason use bots, this will hide them as well.
For CSS:
Change "tf_player_manager" to "cs_player_manager", and "CTFPlayerResource" to "CCSPlayerResource".