AddCommandListener doesn't even listen to the command, and IDK how to use PTaH without getting weird errors like " 11/01/2019 - 2300: [SM] Exception reported: Invalid event PTaH_HookType specified" from the hook of "PTaH(PTaH_ExecuteStringCommand, Hook, PTaH_Hook_ExecuteStringCommand);"
The reason I need this is to rewrite the status command to allow admins to become invisible from the command, so nobody in the server will know they exist in the server.
i don't know if this will work in cs go but in L4D2 it works.
This is what I got without the plugin
PHP Code:
hostname: Left 4 Dead 2
version : 2.1.5.5 7227 insecure (unknown)
udp/ip : 169.254.143.50:27016 [ public 77.82.165.4:27016 ]
os : Windows Dedicated
map : c8m1_apartment
players : 1 humans, 0 bots (8 max) (not hibernating) (unreserved)
# userid name uniqueid connected ping loss state rate
# 2 1 "♥฿Ĥaŧɏощᵈᶤᵉ♥" STEAM_1:0:209917432 16:06 54 0 active 30000
# 3 "Zoey" BOT active
# 4 "Louis" BOT active
# 5 "Francis" BOT active
#end
This is what I got with the plugin
PHP Code:
hostname : Left 4 Dead 2
version : 2.1.5.5 7227 insecure (unknown)
udp/ip : x.x.x.x:x [ public x.x.x.x:x ]
os : Windows Dedicated
map : c8m1_apartment
players : 0 humans, 3 bots (8 max) (not hibernating) (unreserved)
# userid name uniqueid connected ping loss state rate
# 3 "Zoey" BOT active
# 4 "Louis" BOT active
# 5 "Francis" BOT active
If I did not know that there is this plugin on the server, I would not have noticed the differences
In any case it can be written even more imperceptibly
Spoiler
Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdktools>
public Plugin myinfo =
{
name = "[L4D2] Gascan Announcer",
author = "BHaType",
description = "Notifies about who broke the gascan",
version = "0.0",
url = "SDKCall"
};
char szName[36], szMap[36];
public void OnPluginStart()
{
FindConVar("hostname").GetString(szName, sizeof szName);
RegConsoleCmd("status", cAction);
}
public void OnMapStart()
{
GetCurrentMap(szMap, sizeof szMap);
}
public Action cAction(int client, int args)
{
if (!client)
return Plugin_Continue;
int iPlayers, iBots;
for (int i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i))
continue;
if (IsFakeClient(i))
iBots++;
else if (!(CheckCommandAccess(client, "sm_unban", ADMFLAG_ROOT)))
iPlayers++;
}
PrintToConsole(client, "hostname : %s", szName);
PrintToConsole(client, "version : 2.1.5.5 7227 insecure (unknown)");
PrintToConsole(client, "udp/ip : x.x.x.x:x [ public x.x.x.x:x ]");
PrintToConsole(client, "os : Windows Dedicated");
PrintToConsole(client, "map : %s", szMap);
PrintToConsole(client, "players : %i humans, %i bots (8 max) (not hibernating) (unreserved)", iPlayers, iBots);
PrintToConsole(client, "# userid name uniqueid connected ping loss state rate");
for (int i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i))
continue;
if (IsFakeClient(i))
PrintToConsole(client, "# %i \"%N\" BOT active", GetClientUserId(i), i);
else if (!(CheckCommandAccess(client, "sm_unban", ADMFLAG_ROOT)))
{
char szAuth[PLATFORM_MAX_PATH];
GetClientAuthId(i, AuthId_Steam2, szAuth, sizeof szAuth);
PrintToConsole(client, "# %i %i \"%N\" %s %.2f 67 0 active 30000", GetClientUserId(i), i, i, szAuth, GetGameTime());
}
}
return Plugin_Stop;
}