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

Solved TF2 force nextmap, after X amount of rounds via plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rushy
AlliedModders Donor
Join Date: Jul 2015
Location: Melbourne, Australia
Old 09-21-2016 , 05:54   TF2 force nextmap, after X amount of rounds via plugin
Reply With Quote #1

Does sourcemod have a function that will change to the nextmap in the cycle?

My code is the following if that helps. The reason I need to do it this way, is that on some maps (like payload) the inbuilt round is not incrementing :

Code:
new Rounds = 0;
public Action:event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
Rounds = Rounds + 1;

if (Rounds >= 3) {
	  PrintToChatAll("3 Rounds have been played. Changing to new map");
	  //command here to force next map
	  }

}
*Edit or is it possible to store sm_nextmap to a string and pass it that way to "changelevel"?

Last edited by Rushy; 09-21-2016 at 06:31. Reason: an idea
Rushy is offline
blacklagoon
Senior Member
Join Date: Jun 2012
Old 09-21-2016 , 06:08   Re: TF2 force nextmap, after X amount of rounds via plugin
Reply With Quote #2

There's
Code:
bool:GetNextMap(String:map[], maxlen);
and
Code:
native ForceChangeLevel(const String:map[], const String:reason[]);
and you should be searching the api : https://sm.alliedmods.net/api/index.php

Last edited by blacklagoon; 09-21-2016 at 06:09.
blacklagoon is offline
Rushy
AlliedModders Donor
Join Date: Jul 2015
Location: Melbourne, Australia
Old 09-21-2016 , 06:32   Re: TF2 force nextmap, after X amount of rounds via plugin
Reply With Quote #3

Quote:
Originally Posted by blacklagoon View Post
There's
Code:
bool:GetNextMap(String:map[], maxlen);
and
Code:
native ForceChangeLevel(const String:map[], const String:reason[]);
and you should be searching the api : https://sm.alliedmods.net/api/index.php
Thanks, I will bookmark that
Rushy is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-21-2016 , 17:05   Re: TF2 force nextmap, after X amount of rounds via plugin
Reply With Quote #4

Quote:
Originally Posted by Rushy View Post
The reason I need to do it this way, is that on some maps (like payload) the inbuilt round is not incrementing
That's intentional as TF2 has a concept known as a "full round."

For multi-stage maps, a full round ends when:
  • PL, A/D CP: BLU captures all control points in all stages of the map.
  • PL, A/D CP: Time runs out during any stage, giving RED the win.
  • PLR: RED or BLU captures the enemy team's point in the last round.

Late edit: In single stage maps, every round is a full round. MvM is kinda/sorta an exception as waves aren't rounds, but do a map reset when the players lose.

Technical details (warning: there be dragons here)

You can't tell if a round is going to be the end of a full round until the round actually ends. This is reported by the teamplay_round_win event's full_round attribute.

The game determines if the end of the round is the end of the full round based on the "Force map reset" setting of the game_round_win entity whose RoundWin input was called.

Calling the team_control_point_master's SetWinner or SetWinnerAndForceCaps inputs instead will always reset the map / cause it to be the end of a full round.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-22-2016 at 02:46.
Powerlord 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 08:57.


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