Raised This Month: $51 Target: $400
 12% 

[ANY] Source TV votekick immunity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 11-09-2020 , 06:46   [ANY] Source TV votekick immunity
Reply With Quote #1

Any idea on how to protect SourceTV against "callvote kick" ?

native bool:IsClientSourceTV(client) could be used i guess.
JLmelenchon is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 11-09-2020 , 09:24   Re: [ANY] Source TV votekick immunity
Reply With Quote #2

PHP Code:
if (IsClientSourceTV(client) || IsClientReplay(client)) 
cravenge is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 11-09-2020 , 14:00   Re: [ANY] Source TV votekick immunity
Reply With Quote #3

What will look like the code in relation to the callvote kick command ?
JLmelenchon is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 11-09-2020 , 20:53   Re: [ANY] Source TV votekick immunity
Reply With Quote #4

It would look 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 (
IsClientSourceTV(iTarget) || IsClientReplay(iTarget))
        {
            return 
Plugin_Handled;
        }
    }

    return 
Plugin_Continue;

I've never had to check for Source TV or Replay before so I don't know what other validity checks are required.
__________________
Psyk0tik is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 11-10-2020 , 03:49   Re: [ANY] Source TV votekick immunity
Reply With Quote #5

Thank you it works at first glance.
JLmelenchon 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 10:31.


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