Skip to content

PlayerCanJoinTeam called as a hook #2236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bailmast
Copy link

@bailmast bailmast commented Mar 13, 2025

  1. PlayerCanJoinTeam probably should be called as a hook instead of being a gamemode function
  2. Fix errors when client provides a nil argument in changeteam command
  3. Get rid of funny duplicating code logic comments

P.s. do not forget to remove a warning if PR merged

@bailmast
Copy link
Author

And probably functions like OnPlayerChangedTeam should have tag "internal" on wiki

@bailmast bailmast force-pushed the teams-hooks-patch branch from 35d65c2 to 3fe5dcf Compare March 14, 2025 01:23
@bailmast bailmast force-pushed the teams-hooks-patch branch from 3fe5dcf to d9c60a4 Compare March 14, 2025 01:26
@bailmast bailmast changed the title hook instead of gamemode function PlayerCanJoinTeam called as a hook Mar 14, 2025
@robotboy655 robotboy655 added the Enhancement The pull request enhances current functionality. label Mar 17, 2025
@robotboy655
Copy link
Collaborator

Do you have a use case for it to be called as a hook though?

I am struggling to think of a scenario where an addon should have control over what team(s) can be joined, and that's provided the gamemode would use the base gamemode hook and not their own system.

Any sort of team player limits or things like that would surely need to enforced by the gamemode?

Do you actually need this to be added, or is this a "just because" idea?

@bailmast
Copy link
Author

bailmast commented Apr 6, 2025

So, I'm currently working on something, and I think it's important for new gamemodes to have that standard to stick with. For example, if someone is creating a new admin system, they will think, 'Ah, it's not an internal hook, so I can use it for punishments,' or they might create mini games unrelated to the gamemode's purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement The pull request enhances current functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants