.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   new CS update screws up intercepting chat messages!? (http://forums.bots-united.com/showthread.php?t=1978)

stefanhendriks 21-06-2004 00:05

Re: new CS update screws up intercepting chat messages!?
 
Yes it should be revised, but thats merely for the looks, not for the game to work properly.

Pierre-Marie Baty 21-06-2004 03:05

Re: new CS update screws up intercepting chat messages!?
 
I don't think so. I use the same TextMsg message that botman's UTIL_SayText uses to display a lot of debugging stuff for my bot, and so far all my messages display fine.

stefanhendriks 21-06-2004 09:01

Re: new CS update screws up intercepting chat messages!?
 
sure they display fine... but have you taken a look at the new format in CS 1.6? If you use that format the 'looks' are different.. thats what i said ;)

Whistler 21-06-2004 10:51

Re: new CS update screws up intercepting chat messages!?
 
Code:


void ClientCommand( edict_t *pEntity )
{
  const char *pcmd = CMD_ARGV(0);
  const char *arg1 = CMD_ARGV(1);

  static int iFillServerTeam = 5;

  if (isFakeClientCommand == 0)
  {
      if (FStrEq(pcmd, "say") || FStrEq(pcmd, "say_team"))
      {
        bool bAlive = IsAlive(pEntity);
        int iTeam = -1;
        if (FStrEq(pcmd, "say_team"))
            iTeam = UTIL_GetTeam(pEntity);

        for (int i = 0; i < gpGlobals->maxClients; i++)
        {
            if (!ThreatTab[i].IsUsed ||
              (iTeam != -1 && iTeam != ThreatTab[i].iTeam) ||
              bAlive != IsAlive(ThreatTab[i].pEdict))
              continue;
            CBaseBot *pBot = g_rgpBots[i];
            if (pBot)
            {
              pBot->m_SaytextBuffer.iEntityIndex = ENTINDEX(pEntity);
              strcpy(pBot->m_SaytextBuffer.szSayText, CMD_ARGS());
              pBot->m_SaytextBuffer.fTimeNextChat = gpGlobals->time + pBot->m_SaytextBuffer.fChatDelay;
            }
        }
      }

I prefer this one since it's much simpler, and the POD-Bot already has code to deal with what bots said.
The only problem is it won't catch other bots' messages if other bots use botman's chat code.

Pierre-Marie Baty 21-06-2004 12:05

Re: new CS update screws up intercepting chat messages!?
 
just remove the if (isFakeClientCommand) check then... :)


All times are GMT +2. The time now is 16:37.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.