Garry's Mod Wiki

GM:PlayerCanJoinTeam

  boolean GM:PlayerCanJoinTeam( Player ply, number team )

Description

Returns whether or not a player is allowed to join a team

This hook will not work with hook.Add and it is only called manually from GM:PlayerJoinTeam by the base gamemode

Arguments

1 Player ply
Player attempting to switch teams
2 number team
Index of the team

Returns

1 boolean
Allowed to switch