How to make "Team Limited"?
That Like Team Terrorist have Limited Join.
so you can't join Terrorist Team again.
Max Player on Terrorist Team is 3.
and CT is normal.
Thanks!
Scripts
Team Limiter
Team Limiter
1

joins = 0
max_joins = 3
addhook("team", "_team")
function _team(id, team)
if team == 1 and joins >= max_joins then
return 1
else
joins = joins + 1
end
end
addhook("leave", "_leave")
function _leave(id)
if player(id, "team") == 1 then
joins = joins - 1
end
end
----- Untested
neiz = {}
addhook("team","neiz.team")
function neiz.team()
	local terrorists = player(0,"team1")
	if #terrorists >= 3 then
		return 1
	end
end
Hajt: Your Scripts is Working
Thanks!.
Louie: Nothing Happen, But Error Output not showed.
Hajt Your scripts give error if i am add
msg2neiz = {}
parse("mp_autoteambalance 0")
addhook("team","neiz.team")
function neiz.team()
local terrorists = player(0,"team1")
if #terrorists >= 3 then
		msg2(id,"©180000000Terrorist Team is Full!, You can't join Terrorist.")
		parse("makect "..id)
		return 1
end
end
Error Output says:Lua: Adding function 'neiz.team' to hook 'team' U.S.G.N.: Sending serverlist ADD-request... U.S.G.N.: Serverlist entry updated U.S.G.N.: Ping/State 'playing' Guuune joins the Terrorist Forces [b]PlayWithWheel connected [b]PlayWithWheel joins the Terrorist Forces [b]Slayer connected [b]Slayer joins the Terrorist Forces [b]PlayWithJoystick connected LUA ERROR: sys/lua/autorun/FurtyAdminScripts.lua:8: bad argument #1 to 'msg2' (number expected, got nil) -> [C]: in function 'msg2' -> sys/lua/autorun/FurtyAdminScripts.lua:8: in function <sys/lua/autorun FurtyAdminScripts.lua:5> -> in Lua hook 'team', params: 4, 1, 0 [b]PlayWithJoystick joins the Terrorist Forces
team and then change this line:function neiz.team()
function neiz.team(id)
Hajt: Your script applies to all team so when there're 3 terrorists, counter-terrorists can't join.function teamhook(id, team)
	return team == 1 and (#player(0, "team1") >= 3 and 1 or 0) or 0
end
addhook("team", "teamhook")
function teamhook(id, team)
	if (team == 1 and #player(0, "team1") >= 3) then
		return 1
	end
	
	return 0
end
addhook("team", "teamhook")
Dousea!
1
