I decided to give this a shot since I hadn't used SourceHook in such a long time It would be a good refresher and also learned a bit more about SourceHook heh.
The source for the extension is in the zip.
Note I gave this a very quick test. Also it seems that SetWinningTeam is called every game frame after a round should end (I assume if you spawn a player it will stop spamming it)
Currently I only compiled it for windows. If you need it for Linux let me know. Ill post it in the extension forum after you test it further
Include file
PHP Code:
enum WinReason
{
WINREASON_NONE =0,
WINREASON_ALL_POINTS_CAPTURED,
WINREASON_OPPONENTS_DEAD,
WINREASON_FLAG_CAPTURE_LIMIT,
WINREASON_DEFEND_TIL_TIMELIMIT,
WINREASON_STALEMATE,
WINREASON_TIMELIMIT,
WINREASON_WINLIMIT,
};
/*
* Called when CTeamplayRoundBasedRules::SetWinningTeam is called
*
* @param team Team that won the round
* @param iWinReason Win reason
* @param bForceMapReset Force map reset
* @param bSwitchTeams Switch teams
* @param bDontAddScore Dont add to the score
*
* Return Plugin_Continue to ignore Plugin_Changed to use the modified values Plugin_Handled and higher to block.
*/
forward Action:TF2_OnSetWinningTeam(&TFTeam:team, &WinReason:reason, &bool:bForceMapReset, &bool:bSwitchTeams, &bool:bDontAddScore);
/* Call to set the winning team and end the round.
*
* @param team Team that won the round
* @param iWinReason Win reason
* @param bForceMapReset Force map reset
* @param bSwitchTeams Switch teams
* @param bDontAddScore Dont add to the score
*
* @noreturn
*/
native TF2_SetWinningTeam(TFTeam:team, WinReason:reason, bool:bForceMapReset = true, bool:bSwitchTeams = false, bool:bDontAddScore = false);