Swap teams plugin without players dying?
EDIT:
Never mind! As a software developer a good way to figure out some problem is to describe it to someone else. Often times you will find the solution while describing it. There was no reason to hook into the player_team event when just creating a command to switch the teams and then do a mp_restartgame to reset the scores works good enough for what I need. I updated the source with the working plugin that auto selcts the team for connecting humans who are not the first human on the server and there is a swapTeams commands that handles swapping and restarts the round. All good. -------------------------------------- I wrote a plugin that forces connecting humans to jon the same team as other humans on the server and when a human player uses the choose team command to change teams all the other humans are switched to the same team and all bots switch teams. It works (with other bugs listed below) but everyone dies when switched. 1) Is there a way to do the team switch so everyone switches teams without dying? Switching teams this way causes the team score to increase and I am trying to avoid that. The game engine will switch teams without the players dying if you are using these and you switch them and do a restart game but I am not using those settings. mp_humanteam bot_join_team mp_restartgame 1 2) I am also forcing the team of humans connecting to be the same team as already in game humans. That was working until I added the swap team feature. It looks like I need another check in the EventPlayerTeam to not switch humans that are -just connecting- and not already in game. How would I do that? 3) I have been wondering what the bool dontBroadcast parms is used for in these hooks? Sort of working plugin with death and bugs with more than 1 human connecting: PHP Code:
|
Re: Swap teams plugin without players dying?
Wow. That was quick. I was going to say that there is a TF2 plugin that allows players to instantly change teams without having to respawn. It's called 'Instantly Change Team'.
Here's a link: https://forums.alliedmods.net/showthread.php?t=329416 |
All times are GMT -4. The time now is 01:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.