AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   TeamSwitch (https://forums.alliedmods.net/showthread.php?t=67292)

MistaGee 02-20-2008 08:58

TeamSwitch
 
4 Attachment(s)
This is a fully mod-independent team switching plugin, which gives an admin the ability to switch players to the opposite team either immediately, when they die, or at the end of the round (where appropriate).
Players can also be switched to spectators.

TeamSwitch detects which mod it is being run on at startup and configures itself accordingly. In CS:Source, the cstrike extension's function is being used, so the players don't die and don't have to select their model again. In all other mods, the SourceMod API's function is used instead, so players will die if they aren't dead when switched.

If a dead player is chosen to be switched after death, they will be switched immediately.

The Admin menu looks like this:

http://diesundas.funzt-halt.net/team...on2_v50000.jpg http://diesundas.funzt-halt.net/team...on2_v50001.jpg


When selecting "On Death" or "On Round end", the menu will show a flag for players who will be switched, like so:

http://diesundas.funzt-halt.net/team...on2_v50002.jpg http://diesundas.funzt-halt.net/team...on2_v50003.jpg

The team names will be displayed correctly for each mod, e.g. in TF2 it's "Red" and "Blue".

If you don't like menus, you can also use these commands:
  • teamswitch <name>
  • teamswitch_death <name>
  • teamswitch_roundend <name>
  • teamswitch_spec <name>
The plugin has been tested to work with CS:Source, DoD:Source, TF2 and Empires, but it should work for every other Mod as well that uses the same team indices.

Note:
Various people have made additions to this plugin and posted them in this thread, e.g. changing player models in CS:S or admin log functionality.


Changes:
1.3:
  • teamswitch_spec command added
1.2:
  • Bugfix: the wrong client IDs were listed in the menu, so the wrong people got selected
Greetz
MGee

DontWannaName 02-20-2008 18:51

Re: TeamSwitch
 
Great, the other team switch plugin is a little bugy but works. Can you add a scramble based on players scores and such. Like mp_scrambleteams but scrambles players based on scores to even the teams up a bit so there isnt one good team?

MistaGee 02-21-2008 05:05

Re: TeamSwitch
 
I've seen the other plugin, but when I looked at the source code trying to figure out what exactly is different in the cstrike edition, I soon gave up because the source code is unreadable.
That's why I've made my own, mod-independent thing, so I don't have to worry about having different plugins on my servers (I'm running 4 different mods, so...)

As for the srambling stuff:
I've thought about it, but I'm not quite sure what's the best way to do it algorithmically. Once I found a good algo, I'll create a new plugin that does it. :)

orij1nal™ 02-23-2008 11:34

Re: TeamSwitch
 
This is working great! thanks MistaGee!

r5053 02-23-2008 16:16

Re: TeamSwitch
 
thx for copying the idea and writing a plugin that do exactly the same like my team switch plugin
http://forums.alliedmods.net/showthread.php?p=549446

DontWannaName 02-23-2008 16:23

Re: TeamSwitch
 
This plugin doesnt quite work right in TF2. When I ask it to switch a player it switches me instead on the menu lol... I dont know whats wrong.

MistaGee 02-23-2008 16:52

Re: TeamSwitch
 
Quote:

Originally Posted by r5053 (Post 588779)
thx for copying my sourcecode without asking

I wrote the whole code by myself, I didn't copy anything from you.

Quote:

Originally Posted by r5053 (Post 588779)
thx for copying the idea and writing a plugin that do exactly the same like my team switch plugin

Well, the idea isn't that original, and I made my own version because I don't see why a CS:Source edition should be neccessary.

Quote:

Originally Posted by DontWannaName (Post 588784)
This plugin doesnt quite work right in TF2. When I ask it to switch a player it switches me instead on the menu lol... I dont know whats wrong.

That shouldn't happen, I'll definitely check this...

[edit]
Sort-of-confirmed, the menu indeed acts a bit weird when there's more than one player in the game. I'll see what I can do.

r5053 02-23-2008 17:19

Re: TeamSwitch
 
you have a variable on a wrong position contact me than you can use code sniplets to fix it

MistaGee 02-23-2008 18:10

Re: TeamSwitch
 
The menu was displayed at the wrong item index when being re-displayed, which caused the behavior I noticed when testing.

I've uploaded a fixed version.

orij1nal™ 02-23-2008 20:48

Re: TeamSwitch
 
I actually just noticed a bug with the command:

teamswitch


It moves me to the opposite team BUT I still have the previous team skin.


ex. I'm a ct, I teamswitch myself during the round to T but players notice I still have a ct skin even though the scoreboard shows me as a T.


All times are GMT -4. The time now is 19:21.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.