CGT-Source icon indicating copy to clipboard operation
CGT-Source copied to clipboard

How to set the player limit?

Open KOYK opened this issue 4 years ago • 2 comments

For example I want to set max players per team to 3 so the total players in both teams will be 6. How can I do that? also thank you for the video tutorials you rock!

KOYK avatar Feb 27 '20 15:02 KOYK

Sorry for the late reply. This will set the number of players. It should be used in the InitGameMode() function if your addon_game_mode.lua

local PLAYERS_PER_TEAM = 3
GameRules:SetCustomGameTeamMaxPlayers(DOTA_TEAM_GOODGUYS, PLAYERS_PER_TEAM)
GameRules:SetCustomGameTeamMaxPlayers(DOTA_TEAM_BADGUYS, PLAYERS_PER_TEAM)

This will limit the number of players per team. However 10 people will be able to connect to the lobby. This will result in 10 people connect to the lobby screen but only 3 slots will be available for radiant and dire (total 6 players).

To fix this you can set the lobby size by editing addoninfo.txt to something like this:

"AddonInfo"
{
	maps			"name_of_my_map_here"
	"IsPlayable"	"1"

	"name_of_my_map_here"
	{
		"MaxPlayers"                    "6"
	}
}

(replace name_of_my_map_here with the file name of the map)

An example of the addoninfo.txt is in this repo https://github.com/pohka/arena-of-clarity/blob/master/addoninfo.txt

pohka avatar Mar 26 '20 01:03 pohka

Thank you!!!

KOYK avatar Apr 02 '20 16:04 KOYK