Raised This Month: $ Target: $400
 0% 

[L4D2] Give kick immunity to bots


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alex101192
Senior Member
Join Date: Aug 2018
Old 12-04-2020 , 19:25   [L4D2] Give kick immunity to bots
Reply With Quote #1

Is this possible? Both survivor and infected. Talking only about empty bots, not players.
Alex101192 is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 12-04-2020 , 20:39   Re: [L4D2] Give kick immunity to bots
Reply With Quote #2

If you're referring to immunity from vote kicks, you can do something like this:
PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

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

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

    
char sType[32];
    
GetCmdArg(1sTypesizeof sType);
    if (
StrEqual(sType"kick"false))
    {
        
char sTarget[32];
        
GetCmdArg(2sTargetsizeof sTarget);
        
int iTarget GetClientOfUserId(StringToInt(sTarget));
        if (
IsFakeClient(iTarget))
        {
            return 
Plugin_Handled;
        }
    }

    return 
Plugin_Continue;

__________________
Psyk0tik is offline
Alex101192
Senior Member
Join Date: Aug 2018
Old 12-07-2020 , 03:44   Re: [L4D2] Give kick immunity to bots
Reply With Quote #3

Quote:
Originally Posted by Crasher_3637 View Post
If you're referring to immunity from vote kicks, you can do something like this:
PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

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

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

    
char sType[32];
    
GetCmdArg(1sTypesizeof sType);
    if (
StrEqual(sType"kick"false))
    {
        
char sTarget[32];
        
GetCmdArg(2sTargetsizeof sTarget);
        
int iTarget GetClientOfUserId(StringToInt(sTarget));
        if (
IsFakeClient(iTarget))
        {
            return 
Plugin_Handled;
        }
    }

    return 
Plugin_Continue;

This works. Thank you very much!
Alex101192 is offline
gothickitty93
Junior Member
Join Date: Oct 2023
Location: Chicagoland
Old 10-12-2023 , 23:11   Re: [L4D2] Give kick immunity to bots
Reply With Quote #4

Hmm. Doesn't seem to work for me. This was done on a non-admin account, but with !votekick made a public command.

L 10/13/2023 - 03:09:12: [basevotes.smx] "mysteamname><STEAM_mysteamid><>" initiated a kick vote against "Rochelle<5><BOT><>"

L 10/13/2023 - 03:09:13: [basevotes.smx] Vote kick successful, kicked "Rochelle<5><BOT><>" (reason "Votekicked")

L 10/13/2023 - 03:09:13: "Rochelle<5><BOT><Survivor>" disconnected (reason "Kicked by Console : "Votekicked"")

Last edited by gothickitty93; 10-12-2023 at 23:13.
gothickitty93 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode