Part of TPG namespace
TPG.PlayerTeams.CanJoin(ply, targetTeam)📋 Has LDoc👁️ 0 viewsUpdated 1 month ago
Description
Would ply joining targetTeam leave the teams unbalanced? Spectator is always allowed. Otherwise counts both teams, subtracts ply from their current team if they are already on one (so switching teams doesn't double-count them), and rejects a join that would make the target team strictly larger than the other.
Parameters
| Name | Type | Description |
|---|---|---|
ply | Player | |
targetTeam | number | TEAM_GREEN, TEAM_RED or TEAM_UNASSIGNED. |
Returns
| Type | Description |
|---|---|
boolean |
Examples
No examples available.
Used In
No usages found in the codebase.