Skip to content

Server: Send bots to welcome cam and not allow players to leave it too soon#19

Open
rtxa wants to merge 3 commits intoLevShisterov:masterfrom
rtxa:fix-sendtospec-bots
Open

Server: Send bots to welcome cam and not allow players to leave it too soon#19
rtxa wants to merge 3 commits intoLevShisterov:masterfrom
rtxa:fix-sendtospec-bots

Conversation

@rtxa
Copy link
Contributor

@rtxa rtxa commented Mar 18, 2020

Sending connecting players to spectator mode using a task works fine, but with bots this is not the case.

This fix blocks bots spawn by sending them to welcome cam mode and letting them spawn after one second.

Basically, to send a player to spectator mode when he is connecting, you have to do it this way to avoid some scoreboard glitchs, like missing server name, entering players not having a team assigned, etc. (Check it here).

  • Use a task to send to spectator the player with a delay of 0.1 seconds in client_putinserver() (you need to have mp_welcomecam turned on)

PD: Maybe this pull request requires a title change and a better explanation.

rtxa added 3 commits March 16, 2020 21:12
This fix was made to don't allow player (mostly bots) to spawn instantly, this is to ensure plugins have enough time to send players to spectators when they enter.
m_bInWelcomeCam wasn't being set to his default value when the player leaves the game.
Should be enough time to send player to spectators (AMXX set_task() min value is 0.1s).
This will make it unnoticeable for players.
@rtxa rtxa changed the title Fix bots not being send to welcome cam Server: Send bots to welcome cam and not allow players to leave it too soon Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant