Handling A Player Joining A Game In Progress
6. Handling a Player Joining a Game in Progress
When a player joins a game in progress, you dont want them to have to wait as a spectator for a new round to start. Ideally, a new player should be able to spawn and start playing immediately. To handle this, you need to add the new player to TeamMap, subscribe to their elimination event, and grant them their first weapon.
When a player joins a game in progress, you don’t want them to have to wait as a spectator for a new round to start. Ideally, a new player should be able to spawn and start playing immediately. To handle this, you need to add the new player to TeamMap, subscribe to their elimination event, and grant them their first weapon.
When a player joins a game in progress, you don’t want them to have to wait as a spectator for a new round to start. Ideally, a new player should be able to spawn and start playing immediately. To handle this, you need to add the new player to TeamMap, subscribe to their elimination event, and grant them their first weapon.
Follow these steps to grant players weapons and subscribe to their player events when they join a game in progress.
- Add a new method
OnPlayerAddedto theteam_elimination_gameclass. This method promotes any player that joins the game in progress to the lowest weapon tier of another player on the team.
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.