Quote:
Originally Posted by oqyh
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 &numClients, char sample[PLATFORM_MAX_PATH], int &client, int &channel, float &volume, int &level, int &pitch, int &flags)
{
if (StrContains(sample, "takingfire") != -1 ||
StrContains(sample, "underfire") != -1 ||
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 (!(0 < client <= MaxClients))
return false;
if (!IsClientInGame(client))
return false;
return true;
}