AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved [CSGO] Any way to block certain bot radio commands? (https://forums.alliedmods.net/showthread.php?t=343048)

Austin 06-10-2023 02:53

[CSGO] Any way to block certain bot radio commands?
 
I would like to keep bots from issuing these two radio commands.
takingfire
needbackup

How would I do this in a plugin?

tx

oqyh 06-10-2023 11:19

Re: [CSGO] Any way to block certain bot radio commands?
 
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;



Vit_amin 06-10-2023 11:26

Re: [CSGO] Any way to block certain bot radio commands?
 
Spoiler

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

Austin 06-16-2023 19:26

Re: [CSGO] Any way to block certain bot radio commands?
 
Quote:

Originally Posted by oqyh (Post 2805830)
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;




All times are GMT -4. The time now is 18:30.

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