View Single Post
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
Old
  (#29)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: NEW STEAM: Failure on detecting round, how do YOU do it? - 17-02-2004

OK, I've finally settled on a solution that works great for me. For those who are interested, I've done the following:

1. Hook onto pfnServerActivate. This tells me when a new round has starting after a map load. I set a bool flag indicating that a round is just about to start: RoundStart = true;

2. Hook onto message "HLTV". If the two bytes in the message are both zero, then this tells me a round has just started. RoundStart = true; Note: This message is sent ONLY after a round is ended and at the same time the new round has started - there's no delay between the message and the start of the new round. It will get sent no matter how the round has been ended, and not just when the round times out.

3. Optional: Hook onto pfnStartFrame
Code:
If (RoundStart) 
{ 
	RoundStart = false;
	// round has started - do whatever is needed; 
 
}
This hook is optional because you could simply activate your round_start code in both the "HLTV" message hook, and in the pfnServerActivate hook.


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut

Last edited by botmeister; 17-02-2004 at 22:15..
  
Reply With Quote