Nevermind. I found a solution for Day of Defeat: Source
PHP Code:
#include <dodhooks>
#include <sdktools_gamerules>
public OnRoundWin()
{
/**
* This dirty way works like a charm
* Since event is called after team has won, the original SetWinningTeam callback is already set up
* However, if we change round state during this callback, it will cause infinite loop during m_flRestartRoundTime
* In other words this event will be fired at every frame until new round starts
* A solution: after event is fired once (for all the plugins), stop the SetWinningTeam hook chain
* Winners panel will still be shown and round will started eventually after bonus round time is expired
*/
StopChain = true;
/**
* I call this Fake-RoundState
* It _should_ set round state to normal, but its wont
* SDKTools actually dont set round state properly as DoD Hooks does
* Why? If I'd use DoD Hooks 'SetRoundState' native, it would change round state immediately
* But this one just allows players to shoot during bonus round (as when round would run as usual)
*/
GameRules_SetProp("m_iRoundState", RoundState_RoundRunning);
}
/* OnSetWinningTeam()
*
* Called when a team is about to win (DoD Hooks).
* ----------------------------------------------------------------- */
public Action:OnSetWinningTeam(index)
{
// Round ended - block hook chain; Plugin_Continue otherwise
return StopChain ? Plugin_Handled : Plugin_Continue;
}
I guess it would work also with TF2 using
DHooks example
__________________