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

Solved [CSGO] Any way to block certain bot radio commands?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austin
Senior Member
Join Date: Oct 2005
Old 06-10-2023 , 02:53   [CSGO] Any way to block certain bot radio commands?
Reply With Quote #1

I would like to keep bots from issuing these two radio commands.
takingfire
needbackup

How would I do this in a plugin?

tx

Last edited by Austin; 06-16-2023 at 19:27.
Austin is offline
oqyh
Senior Member
Join Date: May 2019
Location: United Arab Emirates
Old 06-10-2023 , 11:19   Re: [CSGO] Any way to block certain bot radio commands?
Reply With Quote #2

you can disable bot radio

bot_chatter "off"
Code:
bot_chatter
Control how bots talk. Allowed values: 'off', 'radio', 'minimal', or 'normal'.

or what you want (not tested)

PHP Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart() 
{
    
AddNormalSoundHook(Call_Back_Sounds);
}

public 
Action Call_Back_Sounds(int clients[64], int &numClientschar sample[PLATFORM_MAX_PATH], int &clientint &channelfloat &volumeint &levelint &pitchint &flags)
{
    if (
StrContains(sample"needbackup") != -|| StrContains(sample"takingfire") != -1)
    {
        for(
int i 1<= MaxClientsi++)
        {
            if(
IsFakeClient(i)) //bot only
            
{
                return 
Plugin_Handled;
            }
        }
        
    }
    
    return 
Plugin_Continue;

or

PHP Code:

#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

char RadioArray[][] = 
{
    
"needbackup",
    
"takingfire"
};

public 
void OnPluginStart() 
{
    for (
int i 0sizeof(RadioArray); i++)
    {
        
AddCommandListener(OnRadioRadioArray[i]);
    }
}


public 
Action OnRadio(int client, const char[] commandint argc)
{
    if(
IsFakeClient(client)) //bot only
    
{
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;

__________________
.:[ >> My Plugins << ]:.

My discord : oqyh
oqyh is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 06-10-2023 , 11:26   Re: [CSGO] Any way to block certain bot radio commands?
Reply With Quote #3

Spoiler

This only hide text and sound feature, when bot get/send radio messages AI code setup/made some actions with another bots

Last edited by Vit_amin; 06-10-2023 at 11:28.
Vit_amin is offline
Austin
Senior Member
Join Date: Oct 2005
Old 06-16-2023 , 19:26   Re: [CSGO] Any way to block certain bot radio commands?
Reply With Quote #4

Quote:
Originally Posted by oqyh View Post
you can disable bot radio

bot_chatter "off"

or what you want (not tested)
I don't want to turn off most bot chatter only a few.

Why I wanted this is because Vit_amin wrote a plugin for me that significantly increases the bot response to radio commands and it works very good!

This is great but the next problem I noticed is the bots that are following my commands which could be follow me, hold this position, need back up, are "interrupted" and stop following my commands when another bot radios for back up
which is all the time!

I thought if I limited their ability to radio for backup it would fix this and it does!
Your example got me far enough along to get this done.

I don't know why you are looping through all clients.
Isn't the client parm to Call_Back_Sounds() the person/bot that issued the command?

This seems to work great and keeps the bots from giving up on my commands!
Thanks!


Vit_amin
I don't understand the point your making.
?


PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

//-----------------------------------------------------------------------------
public void OnPluginStart()
{
    
AddNormalSoundHook(Call_Back_Sounds);
    
PrintToServer("ABS_CSGO_BotRadio Loaded");
}

//-----------------------------------------------------------------------------
public Action Call_Back_Sounds(int clients[64], int &numClientschar sample[PLATFORM_MAX_PATH], int &clientint &channelfloat &volumeint &levelint &pitchint &flags)
{
    if (
StrContains(sample"takingfire")    != -||
        
StrContains(sample"underfire")     != -||
        
StrContains(sample"bottarget")     != -1)
    if(
IsValidClient(client) && IsFakeClient(client))
    {
        
PrintToServer("BLOCKED RADIO %s"sample);
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;
}

//-----------------------------------------------------------------------------
bool IsValidClient(int client)
{
    if (!(
client <= MaxClients))
        return 
false;
    if (!
IsClientInGame(client))
        return 
false;
    return 
true;


Last edited by Austin; 06-16-2023 at 19:28.
Austin 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 01:31.


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