Raised This Month: $68 Target: $400
 17% 

[TF2]Editing Round Timer


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 08-21-2019 , 13:48   [TF2]Editing Round Timer
Reply With Quote #1

Not entirely sure if this has been shared yet, but in my latest zombie mod we moved to an entity based timer created through the zombie mod itself. But for some reason it didn't work no matter what method we tried. Other entities worked just fine. But team_round_timer acted differently. And yes, I removed all other timers OnMapStart.

Thought I'd share my discoveries. So simply put, if you wish to have a plugin control teamplay_round_timer you must create the entity AFTER teamplay_round_start event. It removes/resets any timer entity when it fires. Now I'll share my script.

PHP Code:
#include <sourcemod>
#include <tf2>

int g_iGameTimer;

public 
void OnPluginStart()
{
  
HookEvent("teamplay_round_start"TeamPlay_Round_Start);
}

public 
TeamPlay_Round_Start(Handle eventm const char[] namebool dontBroadcast)
{
  
g_iGameTimer CreateEntityByName("team_round_timer");
  
//Dispatch Key Value/Inputs/Spawn Here
}

//Also you may want to remove this entity at end of round, or make it repeatable and re-use it.
//Note this allows you to completely control tf2 gameplay through the mod. You can add/remove time at any given point etc. 
As far as I know this is the only entity that acts this way. Also consider deleting all other team_round_timers that might be included in the map to prevent interference between the two.

Hope this helped anyone.
Halt is offline
 


Thread Tools
Display Modes

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 23:18.


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