Raised This Month: $51 Target: $400
 12% 

Team Fortress - End Round?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tepp
New Member
Join Date: Aug 2008
Old 08-11-2008 , 15:26   Team Fortress - End Round?
Reply With Quote #1

Is there a way to end a round via sourcemod code in Team Fortress 2? Either win for one side, or stalemate the game?
tepp is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 08-11-2008 , 16:18   Re: Team Fortress - End Round?
Reply With Quote #2

If you take a look at my Sudden Death Melee Redux plugin, I use an SDKCall to force the round to sudden death. There might be a similar virtual function you can use to force a team to win.
bl4nk is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 08-11-2008 , 16:58   Re: Team Fortress - End Round?
Reply With Quote #3

Ah, I forgot. You can always trigger the "SetWinner" input on the "team_control_point_master" entity.
bl4nk is offline
tepp
New Member
Join Date: Aug 2008
Old 08-12-2008 , 00:07   Re: Team Fortress - End Round?
Reply With Quote #4

Thank you so much!

Unfortunately I am writing this mod for ctf maps that don't respect the timer, so I cannot use team_control_point_master, or game_round_win. We've had to pull a few custom maps from our rotation server because they just keep on going when the timer hits 0:00, without ending. Since this is a rotation server, we really don't want it to be stuck on any map for too long.

The SDKCall works great, thank you. At least we can play the maps again and have them end with a stalemate. I was hoping to have the team with more points win, but this works for now.

Do you know where I can find other offsets for SDKCall? There must be an offset for winning, just like there is one for stalemate.
tepp is offline
strontiumdog
Veteran Member
Join Date: Jan 2007
Location: BC, Canada
Old 08-12-2008 , 02:43   Re: Team Fortress - End Round?
Reply With Quote #5

With CTF maps, you can add your own team_control_point_master.

PHP Code:
public RoundStartEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
   new 
edict_index FindEntityByClassname(-1"team_control_point_master")
    if (
edict_index == -1)
    {
        new 
g_ctf CreateEntityByName("team_control_point_master")
        
DispatchSpawn(g_ctf)
        
AcceptEntityInput(g_ctf"Enable")
    }

Then you can do
PHP Code:
         SetVariantInt(winners)
         
AcceptEntityInput(g_ctf"SetWinner"
__________________
Plugins | TheVille
Zombie Mod for DoD:S - l4dod.theville.org
strontiumdog is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-13-2008 , 10:35   Re: Team Fortress - End Round?
Reply With Quote #6

This should work in any Source game:
Code:
new iGameEnd  = FindEntityByClassname(-1, "game_end"); if (iGameEnd == -1 && (iGameEnd = CreateEntityByName("game_end")) == -1) {     LogError("Unable to create entity \"game_end\"!"); } else {     AcceptEntityInput(iGameEnd, "EndGame"); }
Edit: err, you want to end the round, not the map, so this is probably not what you're looking for.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 08-13-2008 at 10:41.
DJ Tsunami is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:06.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode