CGT-Source
CGT-Source copied to clipboard
How to set the player limit?
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!
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
Thank you!!!