Closed lunatixxx closed 3 years ago
https://github.com/Attano/L4D2-Competitive-Framework/blob/master/addons/sourcemod/scripting/readyup.sp#L625
https://github.com/Attano/L4D2-Competitive-Framework/blob/master/addons/sourcemod/scripting/pause.sp#L390
Those plugins would need a little modification to send the panel to the SourceTV client; currently they just skip sending it to any fake clients.
Need to remove !IsFakeClient(client) ? Any downside ?
Just need to edit the for-loop to check if a fake client happens to be the SourceTV bot.
Handle g_hSourceTVName;
public void OnPluginStart()
{
g_hSourceTVName = FindConVar("tv_name");
}
Then the for-loop would look like
// declate variables and store SourceTVbot's name outside of loop
char sSourceTVBot[32], sClientName[32];
GetConVarString(g_hSourceTVName, sSourceTVBot, sizeof(sSourceTVBot));
for (new client = 1; client <= MaxClients; client++)
{
if (!IsClientInGame(client)) continue;
// skip fake clients other than sourceTV
if (IsFakeClient(client)
{
GetClientName(i, sClientName, sizeof(sClientName));
if (!StrEqual(sClientName, sSourceTVBot, true))
{
continue;
}
}
if (hiddenPanel[client]) continue;
SendPanelToClient(menuPanel, client, DummyHandler, 1);
}
My edits are in new syntax. Sorry don't want to bother with legacy formatting for an example.
Please don't look for SourceTV bot by comparing its name with "tv_name" value.
Adding a simple condition IsClientSourceTV will suffice. 😃
In your case a code would be:
for (int client = 1; client <= MaxClients; client++)
{
if ( IsClientInGame(client) && ( !IsFakeClient(client) || IsClientSourceTV(client) ) ) // notice the brackets
{
// send panel
}
}
Need to remove !IsFakeClient(client) ? Any downside ?
Don't think there is, might as well just do that. 👍
I tried your method by adding isclientsourcetv but it does not appear on demos, maybe it does on broadcast? edit: it does not too
Looks like this prevents from sending it to SourceTV, and this returns "true", even though menu is never displayed.
I'm afraid issue is out of scope of this repository.
You might want to print updates into the console of SourceTV, or open an issue at SourceMod repository. In latter case menus will lose their interactiveness so it might require more changes to the API.
Or, if you feel like it, you may send a raw menu data to a SourceTV bot.
It is not really a solution because you lose a lot of informations without menus, but i guess i could make a plugin who send chat messages about ready up and pause status.
Opening an issue might end up being a solution. 😁
Is it something conceivable and does the concerned plugins need some modifications ? I am not sure about when you are a source TV client, but on demos i can confirm that "readyup" or "pause" menu does not appear.