Jump to content

Max players in a team


Ultra

Recommended Posts

Posted

Hey there..

Is there anyway to limit the maximum amount of people in one team?

 

Like if I have a CMD for example /police to join PD.. how can I make it so they can't join PD if 5 people are already in PD?

 

Thanks <3

Posted
max = 5
function setTeamPolice(player)
	local police = getTeamFromName("police")
		if #getPlayersInTeam(police) < max+1 then
		setPlayerTeam(player,police)
	end
end

addCommandHandler("police",setTeamPolice)

 

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...