View Single Post
Re: help - radio emulation
Old
  (#13)
commonbullet
Member
 
commonbullet's Avatar
 
Status: Offline
Posts: 49
Join Date: Nov 2004
Default Re: help - radio emulation - 26-10-2005

Now trying to find how bots read users radio messages.

This is from dll.cpp.

I need a help to read this - I guess it's also checking the selected item from the radio-menu of the sender.
Code:
// Check Radio Commands (fix): do it here since metamod won't call our own ClientCommand()
	 iClientIndex = ENTINDEX (pFakeClient) - 1;
	 if (clients[iClientIndex].IsAlive && (iRadioSelect[iClientIndex] != 0) && (strncmp (g_argv, "menuselect", 10) == 0))
	 {
		 iRadioCommand = atoi (g_argv + 11);
		 if (iRadioCommand != 0)
		 {
			iRadioCommand += 10 * (iRadioSelect[iClientIndex] - 1);
			if ((iRadioCommand != RADIO_AFFIRMATIVE)
				&& (iRadioCommand != RADIO_NEGATIVE)
				&& (iRadioCommand != RADIO_REPORTINGIN))
			{
			 for (i = 0; i < gpGlobals->maxClients; i++)
			 {
				 if (bots[i].is_used && (bots[i].bot_team == clients[iClientIndex].iTeam)
					 && (pFakeClient != bots[i].pEdict))
				 {
					 if (bots[i].iRadioOrder == 0)
					 {
						bots[i].iRadioOrder = iRadioCommand;
						bots[i].pRadioEntity = pFakeClient;
					 }
				 }
			 }
			}
			g_rgfLastRadioTime[clients[iClientIndex].iTeam - 1] = gpGlobals->time;
		 }
		 iRadioSelect[iClientIndex] = 0;
	 }
	 else if (strncmp (g_argv, "radio", 5) == 0)
		 iRadioSelect[iClientIndex] = atoi (g_argv + 5);
	 // End Radio Commands
  
Reply With Quote