![]() |
NEW STEAM: Failure on detecting round, how do YOU do it?
Here is my sollution, probably many use it as i believe i got this from the forums when i just started RB :D
Code:
edict_t* pfnFindEntityByString(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue) Perhaps an engine message gets sent ALL THE TIME (also on dedicated server) so we can use that as a sollution? |
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
Ah. Here's the pitfall.
I believe it's eLiTe who figured out this code. Anyhow... I always suspected this was not a clean way to detect round start. I will run some tests using my o-so-handy PMtools plugin. Perhaps I can find a network message that is sent at round start and only then. Back in 2 minutes... |
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
I admit this is method is probably not the most clean one, but it worked all the time, and as long as it works, don't fix things that are not broken (yet? :D)
|
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
HOLY SHIT!
Here's what is sent as soon as I toggle sv_restartround to 1: Code:
PMTOOLS (HUD): NULLENT [= Game] SENDS MESSAGE type 76 ("TextMsg") in 2 ("MSG_ALL") from NULL |
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
I don't know about teamscore, i thought i have seen it changed directly after the bomb exploded or hostages have been rescued. So i am not sure about that.
I did see a roundtimer got set too? |
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
yes... the RoundTime message. What if we tested this one ?
|
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
WORKS!!!!!! :D :D :D
this message is sent ONLY when the round restarts ! it is NOT sent when you change the mp_roundtime CVAR ! Here's the fix, guys ! in pfnMessageBegin(): Code:
else if (msg_type == GetUserMsgId ("RoundTime")) |
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
PMB I looked at your plugin solution. It seems that you won't detect the very first round start because "round_end" is set to true only after the round ends. To start off, round_end should be initialized to true, that way on the first start frame the first round start will be detected.
Your code may be fine if the intention is to detect only the end of a round, but I did not dig into it that far. *edit* I see another problem. What about a map change before a round ends? For example, if you issue a changelevel command in the middle of a round, will the roundend message be sent? Even if the roundend message is sent, several frames may go by before the map starts to load up, and your plugin will not be aware of exactly when the first round of the new map started. It will instead think the round started before the map even started to load up. Tosolve this, you will have to also add the round_end detection in pfnChangeLevel, in PMB's case, set the bool Code:
round_end = true I have not yet tested any of this with the new CS 1.6 update (I am coding the changes now as I type), so don't assume I know what I'm talking about. I'll post updates once I have my updates coded and tested. *edit* I am assuming that the roundtime message is sent directly after a round ends, not when a round begins. |
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
FINALLY BU works again.
And i got the fix too, this one is with help from Alfred. Using messages with destination MSG_SPEC... engine.cpp Code:
// STEFAN Code:
// STEFAN |
Re: NEW STEAM: Failure on detecting round, how do YOU do it?
Nice... but I prefer my method. Less code involved :P
and my method always works since any map change / map start / server start calls ServerActivate(), which resets all the round and mission parameters and sets mission.finished to TRUE automatically. :) *edit* in CS 1.5 at least, RoundTime is sent for the first round too, so it DOES indeed catch every round START. I don't know for CS 1.6. Can one of you confirm ? |
All times are GMT +2. The time now is 18:20. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.