SirPlease / L4D2-Competitive-Rework

Just refreshing and optimizing the core files a bit, eh?
GNU General Public License v3.0
248 stars 134 forks source link

Caster system and source tv #476

Closed lunatixxx closed 2 years ago

lunatixxx commented 2 years ago

Is it possible to exclude source tv bot from the kick vote? Last time i tried it was kicking it.

A1mDev commented 2 years ago

This condition is met for SourceTV in the sourcemod and we don't get to the code that should kick the player.

SirPlease commented 2 years ago

It shouldn't be doing that, the official term would be IsClientSourceTV, but like A1m said, FakeClient should cover it as it's the wider range.

lunatixxx commented 2 years ago

I am using that to protect sorucetv against kick by players, but it does not keep immunity with !kickspecs

#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart()
{
    AddCommandListener(cmdCallVote, "callvote");
}

public Action cmdCallVote(int client, const char[] command, int argc)
{
    if (!(0 < client <= MaxClients && IsClientInGame(client)))
    {
        return Plugin_Continue;
    }

    char sType[32];
    GetCmdArg(1, sType, sizeof sType);
    if (StrEqual(sType, "kick", false))
    {
        char sTarget[32];
        GetCmdArg(2, sTarget, sizeof sTarget);
        int iTarget = GetClientOfUserId(StringToInt(sTarget));
        if (IsClientSourceTV(iTarget) || IsClientReplay(iTarget))
        {
            return Plugin_Handled;
        }
    }

    return Plugin_Continue;
} 
A1mDev commented 2 years ago

In game 'l4d' this function 'IsClientReplay' is meaningless because this code does not exist in the game. In any case, as stated above, this code cannot kick a SourceTV bot via kickspec.

lunatixxx commented 2 years ago

Yep apparently in the most recent version it does not kick soruce tv